Tuesday, November 5, 2013

How to stop auto populate in text field ?

Auto-Populate: When we type something in text fields and form submits, the values still be accessible, visible when ever we click in the text field after. These values are stored in the client browser so it will populate in it.

                               For some of the textfields in forms would require secure and need privacy. Some client don't want to make the information/data to be shown to public. Browsers dont' clean cached data as it  completely depends on setting that the browser has. Data will reside in it and be populated as per the text field names.

                            To avoid such population to public, text field has property called "autocomplete" and needs to appended to existing attributes.  You have to set that property to value "off".

Ex: <input type="customername" name="customername" autocomplete="off" />. 

Values will not populate when we set it to "off".






No comments:

Post a Comment