when i select a type from a drop down box the form fields are changing . changing means hiding or showing , so according to the drop-down value the form fields are hiding and showing , i need to add j query validation plugin to this form ,
i have a input
<div class="form-item">
<div class="catergory-inputs">
<input name="address" type="text" class="textarea_medium"
id="Address" value="<?php echo $address['value'] ; ?>" />
</div>
</div>
i validate this
var x=$("#contactinfo").validate({
rules: {
address: {
required: true,
minlength: 3,
maxlength: 50,
lettersonly: true
},
},
messages: {
address: {
required: "Enter your Address",
minlength: "At least 3 characters long"
},
}
});
i want to validate this field if only this field is not hiding . like this
var x=$("#contactinfo").validate({
rules: {
if(not hiding) {
address: {
required: true,
minlength: 3,
maxlength: 50,
lettersonly: true
}
},
},
messages: {
if(not hiding) {
address: {
required: "Enter your Address",
minlength: "At least 3 characters long"
}
},
}
});
how can i do this , i saw similar questions in stack-overflow .but there were no answer to mh question there , plz help me ............................. :(