How could I use jquery to check if text-fields are empty when submit without loading login.php
?
<form action="login.php" method="post">
<label>Login Name:</label>
<input type="text" name="email" id="log" />
<label>Password:</label>
<input type="password" name="password" id="pwd" />
<input type="submit" name="submit" value="Login" />
</form>
Thanks.
you need to add a handler to the form submit event. In the handler you need to check for each text field, select element and password fields if there values are non empty.
You can do this:
FIDDLE DEMO