Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to avoid listing previously entered values in certain text fields of a form? HTML, PHP [duplicate]

In my HTML FORMs, when I focus certain text fields they list down history of values entered previously. Is it possible to avoid this auto-drop-down? I am not looking for some browser settings tips for my computer, instead, I want these settings for all of the users of my website filling a form.

Will it also be possible to apply these settings for some selected text fields only? as historical values for some text fields may be helpful for a particular user using his/her machine.

May be this could be achieved using Javascript, but no clue where to start from.

Thanks for your help.

PS: I am using PHP and Javascript (JQuery).

like image 849
TigerTiger Avatar asked Jun 29 '09 15:06

TigerTiger


People also ask

How do I clear the previous text field value after submitting the form with out refreshing the entire page?

The reset() method resets the values of all elements in a form (same as clicking the Reset button). Tip: Use the submit() method to submit the form.

How do I stop autofill in HTML?

Use the <input> tag with autocomplete attribute. Set the autocomplete attribute to value “off”.

How do I turn off TextBox suggestions?

Click the Display tab. Do one of the following: To enable AutoComplete for the text box, select the Enable AutoComplete check box. To disable AutoComplete for the text box, clear the Enable AutoComplete check box.


2 Answers

Add the attribute autocomplete="off" to each of your form elements.

This is not part of the W3C HTML standard, but it does work in both Mozilla & IE browsers.

like image 169
Matt Bridges Avatar answered Oct 05 '22 16:10

Matt Bridges


Try autocomplete="off" in your <form> or <input> tag, see this Mozilla article, this MSDN page and this Safari Reference page for more info. Looks like Safari has only documented the use of the attribute on individual <input> tags though.

See also the answers to the question How can I prevent Firefox’s Autocomplete?

like image 35
Paul Dixon Avatar answered Oct 05 '22 14:10

Paul Dixon