jQuery UI Widgets Forums Editors CheckBox, RadioButton Changing rule for checkbox

This topic contains 1 reply, has 1 voice, and was last updated by  ToddHaddaway 9 years, 5 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • Changing rule for checkbox #75853

    ToddHaddaway
    Participant

    Hello,

    I have a page that contains 2 checkboxes (CheckboxA, CheckboxB). CheckboxB has a rule that says it is required.

    	            $('#initalPageForm').jqxValidator({
    	             rules: [
    		                    { input: '#CheckboxB', message: 'You must contact your instructor', action: 'change', rule: 'required', position: 'right:0,0'},
    

    The behavior I want is that when checkboxA is checked, that checkboxB is not shown and is not required. I have the part working to not show checkboxB:

    	            $("#checkboxA").bind('checked', function (event) {
        					$("#checkboxB").jqxCheckBox({ disabled: true });
        					$("#checkboxB").css("display", "none");
     	                
    	            });
    

    My question is, how do I change the rule for checkboxB to NOT require it when checkboxA is checked?

    Thank you,
    Todd

    Changing rule for checkbox #75859

    ToddHaddaway
    Participant

    I figured it out. I made use of the “function()” solution given in this article

    http://www.jqwidgets.com/community/topic/validate-a-field-based-on-the-value-of-another-field/

    Thanks

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.