我有一个输入字段,用于存储检查条件的vales.I将它改为hidden.if条件为false我需要显示一条消息。如何使用jquery在隐藏字段中显示消息
如果该字段被隐藏,则不显示消息。
HTML
<input type="hidden" id="year1_req_fund_hidden" name="year1_req_fund_hidden">
jQuery的
#wizard5').validate(
{
rules: {
year1_req_fund_hidden:{
//required:true,
number:true,
validate_check: [$('#year1_grand_amt').val(),'1'],
},
},
});
$.validator.addMethod("validate_check",
function(value, element, params) {
if(params[0]!=''){
if(value == params[0]) {
return true;
}
}
},
$.format("The total amount requested does not match with grant amount {0} requested in Q1.11 in year {1} .")
);
请人helpm我
这会给你一些想法https://stackoverflow.com/questions/6966221/how-to-check-if-an-input-element-is-hidden – Saurabh