2012-07-17 90 views
0

我在本地网站上使用bValidator插件,我坚持与表单验证的最后一部分。下拉选项列表验证与bvalidator

我想验证一个下拉列表选项,但不知何故,它不工作。有可能有一种解决方法来实现这个工作。我将衷心感谢您的帮助。

http://jsfiddle.net/2CLZj/


<br /><br /><br /> 

<input type="text" data-bvalidator="required" data-bvalidator-msg="message" name="some" id="some" /> 

<br /> 

<br /> 


<select id="branche_select" data-bvalidator="required"> 
<option value="selecteer">Select your branche</option> 
<option value="Marketing">Branche A</option> 
<option value="Marketing">Branche B</option> 

</select> 

<input type="submit" value="submit" name="submit"/> 

感谢

回答

1

设置默认选项的value""

<select id="branche_select" data-bvalidator="required"> 
    <option value="">Select your branche</option> 
    <option value="Marketing">Branche A</option> 
    <option value="Marketing">Branche B</option> 
</select> 

例如:http://jsfiddle.net/rEF6h/

+0

哇,谢谢安德鲁!这使我的一天:)。 – Twana 2012-07-18 00:01:45

+0

@Twana:没问题!如果有帮助,请记住接受答案! – 2012-07-18 00:06:05

+0

是的,完成;)。干杯! – Twana 2012-07-18 00:39:48