ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

jQuery: Just Submit the Darn Form, No Fancy Stuff

May 04, 2011 1:07pm

Subscribe [3]
  • #1 / May 04, 2011 1:07pm

    Unifusion

    103 posts

    Hi there,

    This is driving me nuts. I’m trying to make a multi-step form using this tutorial, but I can’t figure out how to actually submit the form at the end.

    I already have a PHP script that will process the form data, so all I need is a way to tell jQuery to “return true” when the last submit button is clicked. I don’t need ajax, I don’t need to specify a success page, I just need the darn thing to submit!

    Help please!

  • #2 / May 04, 2011 10:56pm

    Rick Jolly

    729 posts

    Would this work?

    $('#your-form-id').submit();

    Edit: I had a look at the tutorial. There are instructions in the conclusion:

    change jQuery line 125 to: $('form').unbind('submit').submit();

    He had set the submit event to return false which makes this necessary. He could have used button input types instead of submit input types to avoid that.

  • #3 / May 05, 2011 12:09pm

    Unifusion

    103 posts

    d’oh! I see that in the conclusion now, I skipped right over it. I wonder why he didn’t just include that in the file download?

    I thought about using buttons instead of submits as well, but I found it made advancing more annoying for the user because you have to either tab to the button or click it with the mouse instead of just hitting Enter.

    Thanks Rick, I really appreciate it 😊

  • #4 / Nov 25, 2012 8:39am

    Fargo

    1 posts

    Old thread, but I have the same issue. I noticed the “line 125” thing, but it’s not working for me. What code am I replacing, or what code should be right before/after $(‘form’).unbind(‘submit’).submit();?

    I’m new to JS and can’t figure out the proper syntax. Thanks!

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases