MyException - 我的异常网
当前位置:我的异常网» Java Web开发 » 使用过jquery validate 的朋友请进帮忙解决个有关问

使用过jquery validate 的朋友请进帮忙解决个有关问题~

www.MyException.Cn  网友分享于:2013-01-13  浏览:44次
使用过jquery validate 的朋友请进帮忙解决个问题~~!!
这是我的JS
$("#saleLaptopAdd").validate({
rules: {
"loginName":{required: true, email: true},
"saleLaptop.serviceCode":{required: true},
"relationMode":{required: true},
"saleLaptop.title":{required: true},
"brand":{required: true},
"saleLaptop.laptopCPUSeriesId":{required: true},
"saleLaptop.cpuCoreTotal":{required: true},
"saleLaptop.monitorSizeId":{required: true},
"saleLaptop.ramSizeId":{required: true},
"saleLaptop.hddSizeId":{required: true},
"saleLaptop.vgaTypeId":{required: true},
"saleLaptop.romTypeId":{required: true},
"saleLaptop.colorId":{required: true},
"saleLaptop.usbTotalId":{required: true},
"saleLaptop.depreciationGrade":{required: true},
"saleLaptop.goodsTotal":{required: true, digits: true},
"saleLaptop.price":{number: true}
},
messages: {
"loginName":{email: "*账户长度或格式不正确"},
"relationMode":{required: "*点击选择联系地址"},
"saleLaptop.title":{required: "*标题未填写"},
"brand":{required: "*请点击选择品牌"},
"saleLaptop.laptopCPUSeriesId":{required: "*必选项"},
"saleLaptop.cpuCoreTotal":{required: "*必选项"},
"saleLaptop.monitorSizeId":{required: "*必选项"},
"saleLaptop.ramSizeId":{required: "*必选项"},
"saleLaptop.hddSizeId":{required: "*必选项"},
"saleLaptop.vgaTypeId":{required: "*必选项"},
"saleLaptop.romTypeId":{required: "*必选项"},
"saleLaptop.colorId":{required: "*必选项"},
"saleLaptop.usbTotalId":{required: "*必选项"},
"saleLaptop.depreciationGrade":{required: "*必选项"},
"saleLaptop.goodsTotal":{digits: "*只能输入整数"},
"saleLaptop.price":{number: "*请输入合法的价格"}
}
}); 


-------------------------------------------
这是下面的form 代码

<form id="saleLaptopAdd" action="" method="post" style="padding-left:36%;">
<input id="filePathStr" type="hidden" value=""> <!--用于保存需要的文件路径 -->
<table border="0" >
<tr>
<td>是否商家用户:</td>
<td>
<input type="radio" name="saleLaptop.isEnterprise" value="1" checked="checked" onclick="isEnterpriseClick('toCity');"/>是
<input type="radio" name="saleLaptop.isEnterprise" value="0" onclick="javascript:$('#isStudent').show();"/>否
</td>
</tr>
<tr id="isStudent" style="display: none;">
<td>学生用户:</td>
<td>
<input id="isStudentInput" type="checkbox" value="1" onclick="isStudentChose(this,'toCity');"/>是
</td>
</tr>
<tr>
<td>帐号:</td>
<td>
<input type="text" id="loginName" name="loginName" onblur="v_nameAndCodeOnBlur(this, 'serviceCode');" onkeydown="nameAndCodeOnChange();"/>
<input type="hidden" id="commonUserId" name="saleLaptop.commonUserId"/>
</td>
</tr>
<tr>
<td>服务码:</td>
<td>
<input type="text" id="serviceCode" name="saleLaptop.serviceCode" onblur="v_nameAndCodeOnBlur(this, 'loginName');" onkeydown="nameAndCodeOnChange();"/>

文章评论

软件开发程序错误异常ExceptionCopyright © 2009-2015 MyException 版权所有