简体   繁体   中英

how to use <input> autocomplete

I have a problem with the autocomplete option in an input tag.
I will make a form and equip it with autocomplete but the autocomplete will not work. Consider the following code:

 <form autocomplete="on">
<p>Full Name</p><br>
<input type="text" placeholder="Full Name" autocomplete="on"><br><p>Address</p>
<input type="text" placeholder="Address" autocomplete="on"><br>
<p>Email</p><br><input type="email" placeholder="Email"autocomplete="on"><br>
<input type="submit">
</form>

But the auto complete does not work. I have the most updated version of Firefox (27.0.1). Does Firefox not support autocomplete or am i doing something wrong?
Thanks

Add a name attribute for your input fields. Otherwise autocomplete does not allow the browser to predict the value as it can't "re-identify" the field.

<form autocomplete="on">
    <p>Full Name</p><br><input name="fname" type="text" placeholder="Full Name"><br>
    <p>Address</p><input name="address" type="text" placeholder="Address"><br>
    <p>Email</p><br><input name="email" type="email" placeholder="Email" ><br>
    <input type="submit">
</form>

By the way: You do not to carry the autocomplete attribute if you have specified it in the <form> form tag. Only add if you want to turn autocomplete for a specific field off.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM