I have a registration form made by the following fields (extract from the code):
<form role="form" id="profile_form" class="contact-form" autocomplete="off">
<input type="text" name="mail" class="input-box form-control" autocomplete="off">
<input type="text" name="nome" class="input-box form-control" autocomplete="off">
<input type="text" name="cognome" class="input-box form-control" autocomplete="off">
<input type="password" name="password" id="password" placeholder="Password" class="input-box form-control" autocomplete="off">
<input type="password" name="verify_password" placeholder="Verifica password" class="input-box form-control" autocomplete="off">
</form>
Firefox is considering cognome field to be the username holder and so on form submitting it is asking to save the password as password (that's fine) and the cognome field as username.
What am I doing wrong here? How am I going to tell firefox to take the email as username?
Related
I have a simple html formula with many input fields:
<input type="text" id="vorname" name="vorname" placeholder="Vorname" autocomplete="given-name" required>
<input type="text" id="nachname" name="nachname" placeholder="Nachname" autocomplete="family-name" required>
<input type="text" id="firma" name="firma" placeholder="Firma" autocomplete="organization">
<input type="text" id="strasse" name="strasse" placeholder="Straße" autocomplete="address-level2" required>
<input type="text" id="plz" name="plz" placeholder="PLZ" maxlength="5" pattern="[0-9]+" autocomplete="postal-code" required>
<input type="text" id="ort" name="ort" placeholder="Ort" autocomplete="street-address" required>
<input ype="email" id="email" name="email" placeholder="E-Mail" autocomplete="email" required>
<input type="tel" id="tel" name="tel" placeholder="Telefon" pattern="[0-9]+" autocomplete="tel" required>
If I call the website with my iPhone and I click on the first input "vorname" I get the option "Fill contact automatically".
All values will be filled automatically except "nachname","firma","Straße","PLZ"
On Safari (macOS) I get no option to filled any fields.
Where is my mistake?
I've a form that works perfectly fine on Chrome, Safari, but not Firefox.
Try#1
<form id="subscribe-form" class="footer-sign-up" action="/subscribe" method="POST">
<input type="text" placeholder="First Name" name="first_name" id="fname" required>
<input type="text" placeholder="Last Name" name="last_name" id="lname" required>
<input id="footer-email" type="text" placeholder="Your Email Address" name="email" required>
<input type="submit" id="subscribe" class="signupbtn" value="sign up">
</form>
Try#2
<form id="subscribe-form" class="footer-sign-up" action="/subscribe" method="POST">
<input type="text" placeholder="First Name" name="first_name" id="fname" required>
<input type="text" placeholder="Last Name" name="last_name" id="lname" required>
<input id="footer-email" type="text" placeholder="Your Email Address" name="email" required>
<button type="submit" id="subscribe" class="signupbtn">sign up</button>
</form>
result
Network Tab
Header
Params
How would one go about debugging this further?
I think I may have found something; if you're submitting via AJAX, but not preventing the page submit, you'll have an issue.
Change part of your code to:
$('#subscribe').click(function(e){
e.preventDefault();
...
This should only do the AJAX submit, and not refresh the page.
I was also able to submit via FireFox by changing button type="submit" to button type="button", so that it won't natively submit the page on press.
You need to add a CSRF token to your form. Assuming this is a blade file:
<form id="subscribe-form" class="footer-sign-up" action="/subscribe" method="POST">
{{ csrf_field() }}
<input type="text" placeholder="First Name" name="first_name" id="fname" required>
<input type="text" placeholder="Last Name" name="last_name" id="lname" required>
<input id="footer-email" type="text" placeholder="Your Email Address" name="email" required>
<input type="submit" id="subscribe" class="signupbtn" value="sign up">
When a page in Laravel loads, you can print a CSRF or Cross Site Request Forgery token which is good for a certain amount of time. Any POST request needs to have a current one of these, otherwise Laravel will give you a page expired error.
I have a problem with this form, no matter which method I use (POST or GET), it doesn't send the request parameters email and pass.
<!DOCTYPE html>
<html>
<body>
<form action="controller/connect_user.php" method="GET">
<label for="email">Email:</label>
<input type="email" id="email" required>
<label for="pass">Password:</label>
<input type="password" id="pass" required>
<button type="submit">Connect</button>
</form>
</body>
</html>
The problem doesn't come from the adress in action, the file is well referenced.
I know I shouldn't use GET for sensitive data, but I used this method because it allows me to see easily the parameters in the URL.
Thank you for your help.
you need to use name attribute to pass data like this:
<form action="controller/connect_user.php" method="GET">
<label for="email">Email:</label>
<input type="email" id="email" name="email" required>
<label for="pass">Password:</label>
<input type="password" id="pass" name="password" required>
<button type="submit">Connect</button>
instead of this:
<form action="controller/connect_user.php" method="GET">
<label for="email">Email:</label>
<input type="email" id="email" required>
<label for="pass">Password:</label>
<input type="password" id="pass" required>
<button type="submit">Connect</button>
</form>
After you can get thhose values like this:
$email = $_GET['email'];
$password = $_GET['password'];
I recommend to you to use POST instead of GET
You need to give your inputs a name:
<form action="controller/connect_user.php" method="GET">
<label for="email">Email:</label>
<input type="email" id="email" name="email" required>
<label for="pass">Password:</label>
<input type="password" id="pass" name="password" required>
<button type="submit">Connect</button>
</form>
Then, in your PHP you can access them like:
echo $_POST['name'];
A input needs a name-attribute, otherwise there is no possiblity to get it (through GET or POST)
<input type="password" id="pass" name="pass" required>
This is my form for user or admin. This formed is saved to database using shared service. After clicking button toaster service is not opening. At first click form will be submitted but form not reseted and toaster service will not open.After doule click only toaster opens and form submitted with empty.
<form method="post" class="minimal" #customerForm=ngForm (submit)="addCustomer()" >
<label for="username">
Username:
<input type="text" name="username" id="username" [(ngModel)]="user.username" placeholder="Enter Username" required="required">
</label>
<label for="password">
Password:
<input type="password" name="password" id="password" [(ngModel)]="user.password" placeholder="Enter Password" required="required" />
</label>
<label for="isAdmin">
Admin:
<select class="admin" type="text" name="admin" [(ngModel)]="user.isAdmin" required>
<option>User</option>
<option>Admin</option>
</select>
</label>
<label for="email">
Email:
<input type="email" name="email" id="email" [(ngModel)]="user.emailId" placeholder="Enter Email" required="required" />
</label>
<label for="phone">
Phone No:
<input type="number" name="phone" id="phone" [(ngModel)]="user.phoneNo" placeholder="Enter Phone" required="required" />
</label>
<label for="dob">
Date of Birth:
<input type="date" name="date" id="date" [(ngModel)]="user.dob" placeholder="Enter Date" required="required" />
</label>
<button type="submit" class="btn btn-minimal btn-submit" [disabled]="!customerForm.form.valid">Create</button>
<toaster-container></toaster-container>
This is my ts file
addCustomer() {
console.log("user",this.user);
this.persistanceService.addUser(this.user).subscribe((result: User) => {
this.cdRef.detectChanges();
console.log("admin",this.user.isAdmin)
this.toast();
this.user = new User();
});
I have a form that I want to submit to paypal. When I submit the form I don't get to the overview for the submitted product but I end up on the default page for paypal.
I started with http://sandbox.paypal.com but I tried the non-sandbox site too.
<form action="http://sandbox.paypal.com/cgi-bin/webscr" id="paypal_form" method="post" name="paypal_form">
<input name="cmd" type="text" value="_xclick">
<input name="business" type="text" value="some#email.com">
<input name="lc" type="text" value="CH">
<input name="item_name" type="text">
<input name="item_number" type="text">
<input name="amount" type="text">
<input name="currency_code" type="text" value="CHF">
<input name="no_note" type="text" value="1">
<input type="text" name="return" value="http://google.com">
<input name="address_override" type="text" value="1">
<input name="country" type="text" value="CH">
<input name="first_name" type="text">
<input name="last_name" type="text">
<input name="address1" type="text">
<input name="zip" type="text">
<input name="city" type="text">
<input name="email" type="text">
</form>
Since I don't get an error at all, I have no idea what is going wrong. I had cases when Paypal told me that I have to provide a city or something like that but now I just get forwarded.
Note: The Charles Proxy tells me that the form was submitted with these values:
The issue is with the action address in your form. You are posting to "http://sandbox.paypal.com/cgi-bin/webscr". Try using "https://www.sandbox.paypal.com/cgi-bin/webscr" instead.