Jump to:

23364 Posts in 18142 Topics by 2862 members

General Questions

SilverStripe Forums » General Questions » use jquery .submit() to submit a form?

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 1371 Views
  • marblegravy
    Avatar
    Community Member
    19 Posts

    use jquery .submit() to submit a form? Link to this post

    I've built a bunch of form checks, validations and actions in javascript with jquery and am trying to load it in to a Silverstripe page and use the built in form handling to do the final sending of the emails.
    The problem I've got is trying to figure out how to submit the form from javascript.

    I've tried using jQuery's .submit() method, but it doesn't work.

    I suspect I need to modify the way that this line behaves in my form code:

        return new Form($this, 'QuoteForm', $fields, $actions);

    adding in a 5th parameter where validation normally fits, but again I'm stuck trying to figure out how to specify my own validation function.

    Can anyone help, or should I post a more thorough example?

  • FullWebService
    Avatar
    Community Member
    38 Posts

    Re: use jquery .submit() to submit a form? Link to this post

    There shouldn't be a problem using jQuery .submit(). You do have to disable the standard validation javaScript. This article explains how to use custom jQuery validation http://ssbits.com/tutorials/2009/using-jquery-for-form-validation/. Hope it helps!

  • marblegravy
    Avatar
    Community Member
    19 Posts

    Re: use jquery .submit() to submit a form? Link to this post

    Sorry for the delay - I've been too busy using my new found power to manipulate forms!

    Thanks heaps for that link - it was exactly what I was after.

    1371 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.