Forum : Is the teaching staff on vacation?
Brief description  about Online courses   join in Online courses
View Avraham  Venismach 's Profile

Is the teaching staff on vacation?

I have been trying to get some response from the teacher and have not heard anything back. Does anyone know if the staff is on vacation? It happened before without notice.

In the meantime perhaps someone might know where I'm going wrong with:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"

"http://www.w3.org/TR/html4/Transitional.dtd">
<html>
<head>
<title>Switch Statment</title>



<script language="javascript" type="text/javascript">
function test()
{
grade = document.frmOne.gradeScore.value
switch(grade){
case '1': alert('Congratulations! Your Grade is an "A!"');break;
case '2': alert('Your Grade is a "B"');break;
case '3': alert('Your Grade is a "C"');break;
case '4': alert('Your Grade is a "D"');break;
case '5': alert('Your Grade is a "F"');break;
case '6': alert('Your Grade is a "G"');break;
default:alert("testing");break;
}
}
</script>



</head>
<body>
<form name="frmOne" id="frmOne" onchange="test()">
<select name="gradeScore">
<option value="">Please Select Your Score</option>
<option value="1">90 to 100</option>
<option value="2">80 to 89</option>
<option value="3">70 to 79</option>
<option value="4">60 to 69</option>
<option value="5">50 to 59</option>
<option value="6">Below 50</option>
</select></form>
</body>
</html>

Thank you!

Asked by Avraham Venismach | Feb 16, 2010 |  Reply now
Replies (2)
View avraham venismach 's Profile
Thank you so much! Was pulling my hair out on this one!
Feb 18, 2010
View teacher siliconindia 's Profile
Hi Avraham,

Your code will work only in firefox.

Problem with your code is w.r.t 'onchange' event. you are putting this thing in form tag and checking select option which is wrong. put that onchange event in select tag. then it will work. see the below code

:
:
:
<body>
<form name="frmOne" id="frmOne" >
<select name="gradeScore" onChange="javascript:test()">
<option value="">Please Select Your Score</option>
<option value="1">90 to 100</option>
:
:
:

Regards,
Vishwanath M S
Feb 17, 2010