jQuery Checkbox Validation Example
<!DOCTYPE html>
<html>
<head>
<title>Checkbox</title>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#button").click(function(){
if($("#checkbox1").is(":checked")==true){
alert("You Select First Checkbox");
}
else
{
alert("Please Select Checkbox");
}
});
});
</script>
</head>
<body>
<form id="form">
<input type="checkbox" id="checkbox1" value="SSC">SSC<br>
<input type="submit" id="button" value="Submit">
</form>
</body>
</html>
<html>
<head>
<title>Checkbox</title>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#button").click(function(){
if($("#checkbox1").is(":checked")==true){
alert("You Select First Checkbox");
}
else
{
alert("Please Select Checkbox");
}
});
});
</script>
</head>
<body>
<form id="form">
<input type="checkbox" id="checkbox1" value="SSC">SSC<br>
<input type="submit" id="button" value="Submit">
</form>
</body>
</html>
Comments
Post a Comment