javascript - get action of submitted form -


i have following code triggered every time user submits form on site.

i want modify slightly, checks action of submission, , based on presence of particular keyword, runs code.

my code follows:

$("form").submit(function() {     //do generic stuff     var formaction = ""; //get action of submitted form      if (formaction.indexof('keyword') !== -1) {         //do specific stuff these forms     } });          

how action of form triggered call?

$("form").submit(function() {     //some stuff...      //get form action:     var formaction = $(this).attr("action");      //some other stuff... });    

Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -