change hidden form field value and submit form on successful jquery validation result

Posted on 2009-02-11
Last Modified: 2012-05-06
Currently I use the onclick event on form button to change a hidden form variable and then submit the form. The hidden variable is used to determine which fusebox action to execute. I would like to incorporate jquery form validation, but cannot work out the best way to achieve this given the current approach to form submission. Any assistance or advice would be much appreciated.
Question by:Glen_Mac
    LVL 16

    Accepted Solution

    There's an amazing form validation plugin for jQuery here:

    Once you have the validation set up, all you'd have to do is do

    if ($('#formID').valid())
      //do form submission

    Open in new window

    LVL 1

    Expert Comment

    onSubmit may be a better cadidate for this purpose than onclick.
    LVL 27

    Expert Comment

    by:Lukasz Chmielewski
    To bring thogether both of experts above, you would have to use the code:
    function checkForm(){
       // here you would have to check for valid fields
       // throught ajax request or inline

    Open in new window


    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Join & Write a Comment

    Suggested Solutions

    Introduction Got endorsements from your clients?  Great!  There is almost nothing better than word-of-mouth advertising.  But how can you do that on the internet?  Sure you can make a page for endorsement quotations and list them all, but who is …
    I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
    The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
    In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now