I am working on an AJAX login system. Right now, when the user clicks on the link, the login form is dynamically loaded when the user clicks on the "login" link. Since I use AJAX for this, I want the form not to submit when the submit button is clicked. I tried the following code as part of the upload function, and the form loads correctly, but the form still submits normally.
$('#loginBox').load('loginform.php'); $('#loginBox form').submit(function(event) { event.preventDefault(); });
How can i fix this?
source share