Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/81.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 单击引导中的标签时,文本框不应聚焦_Php_Jquery - Fatal编程技术网

Php 单击引导中的标签时,文本框不应聚焦

Php 单击引导中的标签时,文本框不应聚焦,php,jquery,Php,Jquery,我使用了jQuery验证。并使用twitter bootstrap 2.3.2。单击“提交”按钮时将显示错误消息。如果单击错误消息,则表示文本框已聚焦。我怎么会失去焦点 <input type="file" name="type1" id="type1"> <label for="type1">This field is required</label> 此字段必填 您可以尝试以下方法: $(function(){ $('input').blur();

我使用了jQuery验证。并使用twitter bootstrap 2.3.2。单击“提交”按钮时将显示错误消息。如果单击错误消息,则表示文本框已聚焦。我怎么会失去焦点

<input type="file" name="type1" id="type1">
<label for="type1">This field is required</label>

此字段必填

您可以尝试以下方法:

$(function(){
  $('input').blur();
});
使用以下命令:

<input type="file" name="type1" id="type1">
<label for="type1" onmousedown="return false;" onclick="return false;">This field is required</label>

此字段必填

onlcick和onmousedown“return false;”将禁用默认浏览器行为。

欢迎使用SO。为了能够帮助您,我们需要您向我们展示您的代码!此字段是必需的,我无法使用它。因为标签是在jQuery验证中自动生成的:(