I have here this form:
<form id="register-form" action="<?=$_SERVER['PHP_SELF']?>" method="post">
<label>Name <span style='color: red'>*</span><br/>
<input type='text' name='user_name'/>
</label>
<label>Email <span style='color: red'>*</span><br/>
<input type='text' name='user_email'/>
</label>
//Another form elements
<button name='register' type='submit'>Register</button>
</form>
To process the form, I use:
if(isset($_POST['register']))
{
//Process
}
What I need is the register
button to be disabled when the user clicks on it. I've found this solution:
$('#register-form').submit(function()
{
$(this).find(":submit").attr('disabled', 'disabled');
});
With this jQuery code the button is disabled when I click on it, but PHP don't process the form. How to fix it?