CODE :-
<html>
<head>
<title>Course</title>
<script type="text/javascript">
function degree()
{
var a=document.f1.c1.checked;
if(a==true)
{
document.f1.ans.value="BCA";
}
var b=document.f1.c2.checked;
if(b==true)
{
document.f1.ans.value="MCA";
}
var c=document.f1.c3.checked;
if(c==true)
{
document.f1.ans.value="Bsc It";
}
var d=document.f1.c4.checked;
if(d==true)
{
document.f1.ans.value="Msc It";
}
return false;
}
</script>
</head>
<body>
<form name="f1" method="post" onsubmit="return degree()">
<input type="checkbox" name="c1" value="bca">BCA
<input type="checkbox" name="c2" value="mca">MCA
<input type="checkbox" name="c3" value="bsc">Bsc It
<input type="checkbox" name="c4" value="msc">Msc It
<br>
<br>
<input type="submit" name="submit" value="Submit">
<br>
<br>
<input type="text" name="ans">
</body>
</html>
No comments:
Post a Comment