Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable text input history [duplicate]

Tags:

php

Possible Duplicate:
How do you disable browser Autocomplete on web form field / input tag?

I am building an application which will be accepting credit card data. I would like to make sure that the browser does not remember what has been typed into the text inputs for credit card number. I tried passing the following headers:

header("Expires: Tue, 03 Jul 2001 06:00:00 GMT"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); 

Still, once the page reloads, I can click the credit card text input field and it will let me see what I wrote in it before. How can I prevent this?

like image 746
Boyan Georgiev Avatar asked Sep 24 '11 15:09

Boyan Georgiev


People also ask

How do I turn off input field history?

1 Answer. Show activity on this post. Simply set autocomplete="off" on your input element.

How do I turn off autofill input?

This can be done in a <form> for a complete form or for specific <input> elements: Add autocomplete="off" onto the <form> element to disable autocomplete for the entire form. Add autocomplete="off" for a specific <input> element of the form.

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.

How do I turn off input editing?

You can either use the readonly or the disabled attribute. Note that when disabled, the input's value will not be submitted when submitting the form. Also It's important to remind that even using readonly attribute, you should never trust user input which includes form submissions.


1 Answers

<input type="text" autocomplete="off"/> 

Should work. Alternatively, use:

<form autocomplete="off" … > 

for the entire form (see this related question).

like image 86
user703016 Avatar answered Sep 22 '22 08:09

user703016