javascript - Working with livevalidation.js -


i using livevalidation.js (http://livevalidation.com/) validate form.

this works having trouble getting need do.

i have 2 fields "how many children" , "age of children"

basically, need check presence of answer in "age of children" if "how many children" filled out.

if have not filled out "how many children", not matter if "age of children" filled out.

i know how check presence, don't know how check if other field filled out.

any appreciated.

if( numofchildren.presence( 'children here', { failuremessage: "supply come childrens!" } ) == true  && ageofchildren.presence( 'children have ages', { failuremessage: "no children!" } ) == true){  //do work  }  

Comments

Popular posts from this blog

Python __call__ special method practical example -

arrays - jQuery - Retrieve values from HTML elements and return their sum -