jquery - Submit username and password javascript (not a form) -


i have popup asks user login information, means 2 input text fields password , username.

now verifying information using ajax didn't wrap elements on because form needs php action, correct? or missing something?

so i'd know if there fancier way check if user pressed enter, in order submit login information, checking each time key pressed, keydown, if it's enter key.

thanks in advance

you still need form wrap user inputs, , form still has action. however, won't full page post. instead, you'll send ajax post. jquery makes easy.

$(function() {    $("#myform").submit(function () {     var data = $(this).serialize();     var url = $(this).attr("action");     $.post(url, data);     return false;   }); }); 

Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -