how to call a custom function onclick() in jquery -


I need to call a function on jquery, this function must submit a form, is it possible?

I need something like this that I need to submit the form on two links. Submission should be done if the user clicks on any of the 2 links. The values ​​of the form are set as hidden regions, so there is no user input other than clicking on the href.

Best practices based on what you are trying to achieve: Say you have There are two elements, which can submit forms with elements of an ID and element:

  $ (function () {$ ("# Element_1, # element_2"). ) {$ ("Form"). Submit ();});});  

If the elements are links that you do not want to follow, you can return at the end of the call; , but if they are simply the input button, which should not be necessary.


Comments