//slip4.html
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<meta charset="utf-8">
<title>Disable/enable the form submit button</title>
</head>
<body>
<input id="accept" name="accept" type="checkbox" value="y"/>Upload File<br>
<input id="submitbutton" disabled="disabled" name="Submit" type="submit" value="Submit" />
</body>
<script>
$('#accept').click(function() {
if ($('#submitbutton').is(':disabled')) {
$('#submitbutton').removeAttr('disabled');
} else {
$('#submitbutton').attr('disabled', 'disabled');
}
});
</script>
</html>
No comments:
Post a Comment