I need to call a function on a using jquery. This function needs to submit a form.
Is this possible?
The reason i need something like this is that i need to have the submission of form happen at two links ie the submission should happen if the user clicks on any of the 2 links. The values of the form are set in as hidden fields so there is no user input except the click on the href.
Best practice based on what you’re trying to achieve:
say you have two elements that should submit the form with the id’s element_1 and element_2:
If the elements are a link you do not want to be followed, you can append
return false;to the end of the call, but if they’re simply input buttons, that shouldn’t be necessary.