How to require fields if a certain radio button is checked with jQuery Validate?

When you click on the checkbox to check the result, you can add the rules manually.

$('#checkbox'). Click(function() { if ($(this). Is(':checked')) { $('#element').

Rules('add', { //rules }); } When you click on the checkbox to check the result, you can add the rules manually.

The problem with this is I need to have rules required by default with the pre-selected radio button. Then I would need to remove them somehow if the other button is clicked and vice versa if the buttons are toggled. – Cofey Jun 7 at 15:23 $('#checkbox').

Rules('remove',{rule(s) to remove); You can choose the rules you want to remove. – José Valente Jun 7 at 15:26 I have a "Search Type" field on a form. As you select from 7 different search types, I remove and add rules to the Search Text field.It works very well once I got the process worked out.

– iKnowKungFoo Jun 7 at 16:22 Got it to work. THANKS! – Cofey Jun 7 at 17:24.

Not sure if this is your problem but your missing a semi-colon on this line return $("inputname='country'value='ca'"). Is(':checked').

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions