在浏览器中禁用表单验证 [英] Disable form validation in browser

查看:144
本文介绍了在浏览器中禁用表单验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用HTML5验证的网站上进行编码 - 目前为止还没有火箭科学。一切工作正常,我在谷歌浏览器,但我想确保即使是没有formvalidation IE 6用户不会插入格式错误的数据到我的MYSQL数据库。



是有什么方法可以关闭Google Chrome或其他一流的浏览器中的HTML5表单验证来测试服务器端的数据验证吗?解决方案

 < form method =postaction =/ foo NOVALIDATE> ...< /形式> 

请参阅这个问题的更多细节。我认为 Junit 也可以帮助测试服务器端的验证。

使用参数化查询获得更多的安全。 (如果SQL查询是使用用户输入形成的)。





编辑

您可以将其设置为关于:标记

步骤:

1.在您的Google Chrome地址栏中,输入about:flags(不含引号),然后按Enter键。 >
2.向下滚动列表直到看到选项禁用HTML5交互式表单验证。

3.单击启用链接。

检查: http://wikibin.org/articles/google-chrome-about-and- chrome-urls.html






编辑2:

刚刚知道,关于:标志是折旧使用使用铬:/ /标志。谢谢@Max。


I'm coding on a website with forms and use HTML5 validation - no rocket science so far. Everything works fine for me in Google Chrome, but I want to get sure that even a IE 6 user with no formvalidation does not insert malformed data into my MYSQL database.

Is there any way to turn off the HTML5 form validation in Google Chrome or some other state-of-the-art browser to test the serverside data validation?

解决方案

To disable validation in HTML5 use

<form method="post" action="/foo" novalidate>...</form>

Refer this question for more details.I think Junit can also help to test server side validations.
Use parameterized query to gain more security. (If SQL query is formed using user input).


EDIT :

You can set it in About:flags
Steps:
1. On your Google Chrome address bar, type "about:flags" (without the quote) and press Enter.
2.Scroll down the list until you see the option "Disable HTML5 interactive form validation".
3.Click the enable link.
Check : http://wikibin.org/articles/google-chrome-about-and-chrome-urls.html


EDIT 2 :
Just came to know that About:flags is depreciated use Use chrome://flags instead. Thanks @Max.

这篇关于在浏览器中禁用表单验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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