Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

General Questions /

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

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

use jquery .submit() to submit a form?

Go to End

3 Posts   1914 Views


Community Member, 19 Posts

7 October 2010 at 11:00am

Edited: 07/10/2010 11:01am

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?


Community Member, 38 Posts

7 October 2010 at 9:25pm

Edited: 07/10/2010 9:25pm

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 Hope it helps!


Community Member, 19 Posts

14 October 2010 at 10:36am

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.