I have a login form. When users press login, the jQuery checks if the fields are empty. If they are not empty id like to submit my form to a page called login_action.php. I am unsure how to do this.
Here’s my JavaScript code:
<script type='text/javascript'>
$(document).ready(function() {
$('#login').click(function() {
if(!$(':text').val()) {
$('#errors').text('enter a username and password');
} else {
// This is where I'd like to redirect
}
});
});
</script>
Just submit the form: