I have a popup which asks the user for login information, which means two input text fields for password and username.
Now as I will be verifying the information using ajax I didn’t wrap the elements on a because form always needs a php action, correct? or am I missing something?
So I’d like to know if there is a fancier way to check if the user pressed enter, in order to submit the login information, than checking each time a key is pressed, with keydown, if it’s the enter key.
Thanks in advance
You still need a form to wrap your user inputs, and that form still has an action. However, you won’t do a full page post. Instead, you’ll send an AJAX post. jQuery makes this really easy.