Is there a way to disable autocomplete for forms on a website?

I just recently learned how to create websites with HTML

and PHP

.

I created a website with a quiz where people ask to translate words at random. The user enters their answers into the form, and the site evaluates the answer as correct or incorrect.

Now when a question is asked twice in a session, autocomplete appears, allowing people to see their previous views. However, for people trying to test their memory, this is not good.

I know I can turn off autocomplete in my browser, but is there a way to tweak the code PHP

or HTML

have auto-fill turn off automatically for this particular form?

+3


source to share


2 answers


autocomplete="off"

must do the trick!

Put this in your tag <form>

or in each tag <input>

like this:



<form autocomplete="off" />
<!-- OR -->
<input type="text" autocomplete="off" value="Text" />

      

+13


source


For each field input

add

autocomplete="off"

      

So:



<input type="text" name="demo" autocomplete="off" value="test" />

      

See https://developer.mozilla.org/en/How_to_Turn_Off_Form_Autocompletion

Also it could be duplication How do I disable browser autocomplete in a web form field / input tag?

+2


source







All Articles