HTML Input Organization Auto-complete

Source: Internet
Author: User

Mozilla Official documentation recommendations

Mozilla Developer documentation recommends using the form settings property tautocomplete= "Off" to prevent the browser from fetching data from the cache to populate the login form.

type="text" name="foo" autocomplete="off" />

But this option is not compatible with some chrome, Firefox.

Compatible with all browsers

The final decision is to use hidden input to accept the browser AutoFill, which will not affect the user experience or be compatible with all browsers.

  <input style="display:none"><!-- for disable autocomplete on chrome --> <input type="text" id="username" name="username" autocomplete="off">

But it doesn't really work on chrome, and you can only block the user name AutoFill on Firefox.

and then we searched and found a new thing.

type="password"  autocomplete="new-password">

Turn Password's AutoComplete property from off to New-password and find that chrome isn't automatically populated, but the user name is still populated on Firefox

Then combined with the 1th attempt, the final result is to use the following method

type="password" style="display: none;"/> <input type="text" autocomplete="off"/> <input class="form-control" type="password" name="tradePassword" id="txPassword" autocomplete="new-password"

This will not be populated on Chrome or Firefox.

HTML Input Organization Auto-complete

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.