Please forgive my ignorance on the matter. I've only recently switched from pHp and older JS conventions am not quite used to the varying syntax. Here goes:
I am building out new forms for my company and am using jQuery for the form validatin. The form has sets of hidden questions that will display based on their country location (which they select from a dropdown). For simpicity sake, I"m just having the questions hidden/ shown based on that selection. So for the form validation, those questions need to be answered only if they're showing. I've everything built out up to validating the radio buttons (for the hidden questions). I've seen cases where people have use a checkbox that when clicked will add requirement to the selected fields. I've the function that adds the requirement written out. But I wish to do the same but only based on value checks (say numerical). But I'm having a hard time with the syntax. I have the following sample code: $("#testForm").validate({ rules: { topic: { required: "#math" }, .................. What would the proper syntax be if I wanted the variable "math" (say it's pulled from an input field) to be equal to "10" before it sets that the id "topic" is required when it starts validaitng. Again, please forgive me if I"m not making any sense at all. Thanks again.