I fixed the problem. It was this method:

var autoHide = function() {
    memberSections.find('.section').hideExtras(memberCount.val());
    youngerSections.find('.section').hideExtras(youngerMemberCount.val
());
}

I changed it to:

var autoHide = function() {
    if(!$('#memberless input').is(':checked')) {
        memberSections.find('.section').hideExtras(memberCount.val());
    }
    if(!$('#younger-memberless input').is(':checked')) {
        youngerSections.find('.section').hideExtras
(youngerMemberCount.val());
    }
}

So that the field validators would not be added back when the
individual sections were excluded.

Thomas

On Apr 30, 2:16 pm, Thomas Allen <thomasmal...@gmail.com> wrote:
> Thanks. I ended up using the classes add/remove style, and it works
> well. However, a method that should be called on every page load is
> not working properly. I am sure that it's being called (tested with
> the console), but the removeValidators() method doesn't seem to work
> properly.
>
> http://content.constructioninst.org/corporate_renewal.html
>
> On every page load, removeValidators will be called, which removes the
> "required" and "email" validation classes found within the jQuery
> object of the selector (first arg) if the caller's checkbox is
> checked. The problem is if, for example, I fill out the first section
> with its required fields, check the first box (which hides the bulk of
> the form), choose "Check" for payment, and submit. If I go back, while
> the hide/removeValidator method ("membersUnnecessary") is called and
> does indicate that the checkbox is checked (the same sections are
> hidden), I cannot re-submit the form: The validation classes are not
> removed.
>
> What can I do to fix this? I know that the code's a bit clumsy, but I
> can explain any specific parts if needed.
>
> Thanks,
> Thomas

Reply via email to