本文介绍了按输入#2阻止用户提交表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



在前面的问题中,我问了同样的问题,但答案是,当用户在文本框中时,我不阻止提交。所以基本上我需要的是能够阻止一个人提交表单,除非明确地点击提交按钮。



编辑:



基本上这样做的主要原因是这是一项雇主调查。在这方面的人将不会是技术上最精明的,我为此作出的客户已经要求这样。

>我将表单设置为onsubmit =return false,并做了这个

 < input type =buttonvalue =提交onClick =document.Survey.submit()style =font-size:1.25em;> 


Well in a previous question I asked the same thing, but the answer that i doesn't prevent a submit when the user is in a text-box.

So basically what i need is the ability to keep a person from submitting a form unless the explicitly click the submit button.

edit:

basically the main reason for doing this is that this is an employer survey. the people on this won't be the most technically savvy, and the client i'm making this for has requested this.

解决方案

i set the form to onsubmit="return false" and did this

<input type="button" value="Submit" onClick="document.Survey.submit()" style="font-size: 1.25em;">

这篇关于按输入#2阻止用户提交表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-22 22:59
查看更多