在下拉列表中验证 [英] validation on dropdownlist
本文介绍了在下拉列表中验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在asp.net中的dropdownlist上应用验证?给我适当的答案
推荐答案
好吧,我想你只是想要确认未选择特定项目.尝试使用jQuery:
Well, I assume you just want to validate that a specific item is not selected. Try using jQuery:
function validate() {
if (
(' ' 返回 假; 其他 返回 真; }
('#myDropDownList option:selected').val() == 'The wrong value') { return false; else return true; }
在下拉菜单的 onchange 事件上,调用 validate 函数.
On the onchange event of the drop down call the validate function.
请尝试本文
http://forums.asp.net/t/1208786.aspx/1?how + to + to + apply + validation + on + drop + down + list [
Please try this article
http://forums.asp.net/t/1208786.aspx/1?how+to+apply+validation+on+drop+down+list[^]
这篇关于在下拉列表中验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文