javascript - How to add custom checking using jquery form wizard -


i want add customized validation function form using jquery form wizard. form has got dropdown box. if select age group 4 5, alerts "answer one". if select age group 5 6, alerts "answer two". else, alerts "anser three". have lot of type conditional questions filter answer. best way do? can make function in external js file?

use jquery addmethod this:

jquery.validator.addmethod("agegroup", function(value, element) {      // code test age groups range  }, "please enter correct range"); 

read docs http://docs.jquery.com/plugins/validation/validator/addmethod

hopefully, works never used it, shore work.


Comments