有没有办法在网站上禁用自动填充表单? [英] Is there a way to disable auto fill for forms on website?

查看:112
本文介绍了有没有办法在网站上禁用自动填充表单?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近才学会使用 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" />

这篇关于有没有办法在网站上禁用自动填充表单?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆