jQuery: jquery form plugin syntax?

Posted by k00k on Stack Overflow See other posts from Stack Overflow or by k00k
Published on 2010-03-15T17:34:14Z Indexed on 2010/03/15 17:49 UTC
Read the original article Hit count: 322

Filed under:
|
|
|

I'm using jquery with the jquery form plugin. I read through a bunch of posts, the docs, etc., and I'm still having trouble with what I believe to be simple. I have a form with some simple text inputs and a couple textareas, and I have this link that I want to trigger submission of that form to a specific method (/email):

<a id="email-data">Send Email</a>

and this jquery in doc ready:

$('#email-data').click(function() {
    var options = {
        url: '/email/',
        success: alert('Email sent.')
    };
    $('#report-giftcard-sales-form').ajaxSubmit(options);   
});

So I would expect it to submit to my /email method, but no such luck. Currently I just have the /email method logging a debug message, so it's as simple as can be.

Any help is greatly appreciated.

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about form