2

I have only recently learned to create websites using HTML and PHP.

I have created a website that has a quiz where people are asked to translate words at random. The user inputs their answers into a form, and the website evaluates the answer as correct or incorrect.

Now when a question is asked twice in a session, auto-fill shows up, allowing people to see their previous submissions. However for people trying to test their memory this isn't good.

I know I can turn off auto-fill in my browser, but is there a way I can adjust the PHP or HTML code so that auto-fill is automatically turned off for this particular form?

psubsee2003
  • 8,395
  • 8
  • 60
  • 77
Kenshin
  • 149
  • 1
  • 1
  • 7
  • You can use JavaScript to disable the auto-fill, here the library: https://github.com/terrylinooo/disableautofill.js – Terry Lin Feb 25 '21 at 08:49

2 Answers2

14

autocomplete="off" should do the trick!

Put this in your <form> tag or in every <input> tag like this:

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

For each input field 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 this maybe a duplication of How do you disable browser Autocomplete on web form field / input tag?

Community
  • 1
  • 1
tim.baker
  • 2,935
  • 5
  • 25
  • 49
  • Thanks for answering, I didn't realize it was a duplicate. I wish I was the first to post the answer, it has 300 up votes. – Kenshin Feb 06 '13 at 09:23
  • There's lot's of questions like that wish I always wish I had the rights too :P – tim.baker Feb 06 '13 at 09:26