I’m using Bassistance jQuery validation plugin and i need to test if 2 inputs are empty, if so then show an error message, else if one of the two fields is completed then that is fine.
This is the form fields:
<label for="para_comp_name">Your name *</label>
<input id="para_comp_name" name="para_comp_name" type="text" value="">
<label for="para_comp_code">Inside track unique code *</label>
<input id="para_comp_code" name="para_comp_code" type="text" value="">
<label for="para_comp_message">Message</label>
<textarea id="para_comp_message" name="para_comp_message" cols="" rows=""></textarea>
<label for="para_comp_image">Upload image</label>
<input id="para_comp_image" name="para_comp_image" type="file" value="" size="16">
Only the fields which are required are the name and unique code, a user can then either fill in either or both the message and image fields.
I just need to validate if they are both empty together.
Thanks
You can add custom validation method:
Try the demo here.