我最近才学会使用 HTML 和 PHP 来创建网站。
我创建了一个有测验的网站,要求人们随意翻译单词。用户将他们的答案输入到表单中,网站将答案评估为正确或不正确。
现在当一个问题在会话中被询问两次时,自动填充显示让人们看到他们以前的提交。然而,对于试图测试他们的记忆的人来说,这并不好。
我知道我可以在我的浏览器中关闭自动填充功能,但是有什么方法可以调整 PHP 或 HTML 代码,以便自动填充此特定表单时自动关闭?
解决方案将它放在< form> 标记或每个< input> 标签是这样的:
< form autocomplete =off/> <! - 或 - > < input type =textautocomplete =offvalue =Text/>
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?
解决方案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" />
更多推荐
有没有办法在网站上禁用自动填充表单?
发布评论