The concept of the elements array in the VBScript!!!
Objective Question Answers!!
<html>
<head><title>Use of VBScript</title>
<link rel="stylesheet" href="mystyle.css">
<script language="vbscript">
sub scoreclick()
dim score
if (form1.elements(0).checked = true) then
score = score + 5
end if
if (form1.elements(5).checked = true) then
score = score + 5
end if
if (form1.elements(11).checked = true) then
score = score + 5
end if
msgbox ("Your score is:" & score)
end sub
</script>
</head>
<body>
<form name="form1">
<p class="question">1. Result of 2+2 is:</p>
<p class="answer">
<input type="radio" name="q1" >4
<input type="radio" name="q1" >5
<input type="radio" name="q1" >6
<input type="radio" name="q1" >10
</p>
<p class="question">2. Who is father of computer?</p>
<p class="answer">
<input type="radio" name="q2" >Mr. Rajan  
<input type="radio" name="q2" >Charles Babbage   
<input type="radio" name="q2" >Charles Darwin  
<input type="radio" name="q2" >Charles Angels
</p>
<p class="question">3. What is DML?</p>
<p class="answer">
<input type="radio" name="q3" >Do More Language  
<input type="radio" name="q3" >Data Mining Language  
<input type="radio" name="q3" >Develop Money Land  
<input type="radio" name="q3" >Data Manipulation langauage
</p>
<input type="button" name="bttncalc" value="Show Score" onclick=scoreclick()>
<input type="Reset" name="reset" value="Reset">
</form>
</body>
</html>
No comments:
Post a Comment