21303 Posts in 5736 Topics by 2603 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1141 Views |
-
use jquery .submit() to submit a form?

7 October 2010 at 11:00am Last edited: 7 October 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?
-
Re: use jquery .submit() to submit a form?

7 October 2010 at 9:25pm Last edited: 7 October 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 http://ssbits.com/tutorials/2009/using-jquery-for-form-validation/. Hope it helps!
-
Re: use jquery .submit() to submit a form?

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.
| 1141 Views | ||
|
Page:
1
|
Go to Top |


