We help IT Professionals succeed at work.

Javascript in HTML form apparently interfering with jQuery validation

LincolnWeb
LincolnWeb used Ask the Experts™
on
expexc-04-17.txtGreetings.  I'm running into an apparent conflict between a pair of javascript functions I'm using in an HTML form and the function I use to run jquery.validate.

In my form, a pair of radio buttons allows users to toggle visiblity between two portions of the page. One portion allows the user to input check information, while the other portion allows the input of financial certificate info.

Each portion contains a unique submit button.  Once a submit button is clicked, the page will process the data entered and then reload, displaying only the portion of the form intially selected.  So, for example, if you initially submitted check info, once the page reloaded you would be able to submit more check info, but nothing about certificates.

I have found when the user clicks a submit button for the first time, the javascript function that calls jquery.validate is keeping the page from submitting.  If I can get past this point, the validation is fine.

I've attached a file with the relevant pieces of code. Let me know if you need anything else, and thank you very much for your help
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Maybe you need to put ids in those radio buttons.

Author

Commented:
Thanks.  I tried that, but it's still not working. I believe I may have to change the structure of the page such that the toggle isn't between visible/hidden page sections, but instead between includes.
Why don't you just use that hidden/shown controls in links instead of radio buttons?
Actually, the concept is flawed because input elements in a form are supposed to be used for other things: data posted to the server.
If this is just a UI control, it should be triggered by an anchor element <a>.

Author

Commented:
Thannk you! Everything is working fine now.