I have two buttons which submit button and save button. The save button is disabled by default so when the submit button is clicked and the form is submitted, the save button will be enabled. Right now what i had done is only the submit button will be disable after I clicked. But I don’t know how to make the save button enable after submit button is disabled.
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<form action="" method="post" class="form-disable">
<input type="text" name="name" placeholder="name"/>
<button type="submit" class="btn btn-default" name="roll" <?php echo isset($_POST['roll']) ? 'disabled="true"' : ''; ?> >Roll Branch </button>
<button type="submit" name="clicked" id="clicked" onblur="validate()" disabled value="true" >Roll Branch </button>
<script>
function validate() {
$("#clicked").attr("disabled",true);
if(valid) {
$("#clicked").attr("disabled",false);
}
}
</script>
</form>
</body>
</html>