View Full Version : Safari incorrectly autofills an email input field with the username

07-12-2017, 10:04 PM

I am using a wordpress plug-in that generates HTML for registration forms. The form includes an input field for the email address (that the plug-in pre-fills with the email address already supplied) and an input field for the password (which you leave blank unless you want to change it) among other things. Here is a snippet of the HTML they generate:

<div class="swpm-edit-profile-form">
<form id="swpm-editprofile-form" name="swpm-editprofile-form" method="post" action="" class="swpm-validate-form">
<input type="hidden" id="swpm_profile_edit_nonce_val" name="swpm_profile_edit_nonce_val" value="5fdf1731e4" /><input type="hidden" name="_wp_http_referer" value="/my-membership/my-profile" /> <table>
<tr class="swpm-profile-username-row">
<td><label for="user_name">Username</label></td>
<tr class="swpm-profile-email-row">
<td><label for="email">Email</label></td>
<td><input type="text" id="email" class="validate[required,custom[email],ajax[ajaxEmailCall]]" value="kjschultz99@gmail.com" size="50" name="email" /></td>
<tr class="swpm-profile-password-row">
<td><label for="password">Password</label></td>
<td><input type="password" id="password" value="" size="50" name="password" placeholder="Leave empty to keep the current password" /></td>
<tr class="swpm-profile-password-retype-row">
<td><label for="password_re">Repeat Password</label></td>
<td><input type="password" id="password_re" value="" size="50" name="password_re" placeholder="Leave empty to keep the current password" /></td>

When this HTML is displayed in Safari, the email field is autofilled with the memorized username (not email) used for the site and the first password field is autofilled as well. Can anyone explain why this is happening? I attached a form that is not autofilled and a form that is.2674526744

07-13-2017, 11:32 AM
Apart from the standard <INPUT> types, HTML5 added a few more including type="email" that might give Safari's autofill a chance t not mess up. The browser autofill is a little crude at best and works really well with a few forms but miserably with most that don't conform to some standard.