Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
98
rated 0 times [  105] [ 7]  / answers: 1 / hits: 34385  / 14 Years ago, wed, january 12, 2011, 12:00:00

I want to use the following anchor to submit a form with jquery to Spring. How is this done?



<a target= title= class= href=>Save</a>


I've tried this, where requestNew is my form:



 $(document).ready(function(){
$(a).click(function(){
$(#requestNew).submit(function(){
$.post(../acctRequests, $(#requestNew).serialize());
});
});
});


It doesn't seem to go anywhere.


More From » jquery

 Answers
98

You are adding a new event handler; all you need to do is trigger the existing ones, and the browser's native functionality:



$(document).ready(function(){
$(a).click(function(){
$(#requestNew).submit();
});
});

[#94245] Tuesday, January 11, 2011, 14 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
shaina

Total Points: 161
Total Questions: 99
Total Answers: 108

Location: American Samoa
Member since Fri, Sep 24, 2021
3 Years ago
;