Okay, I am getting an error when I preview my script in Frontpage. It says:
test_taker is undefined.
here's the script. I can't tell what I'm doing wrong. It should be defined as the text form named test_taker
<script language="JAVASCRIPT">
function grading(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10){
var right = 0;
var passed = 0;
if (a1 == "T"
or (a1 == "t"
;{
right = (right + 1);
}
if (a2 == "T"
or (a2 == "t"
;{
right = (right + 1);
}
if (a3 == "F"
or (a3 == "f"
;{
right = (right + 1);
}
if (a4 == "T"
or (a4 == "t"
;{
right = (right + 1);
}
if (a5 == "F"
or (a5 == "f"
;{
right = (right + 1);
}
if (a6 == "T"
or (a6 == "t"
;{
right = (right + 1);
}
if (a7 == "T"
or (a7 == "t"
;{
right = (right + 1);
}
if (a8 == "F"
or (a8 == "f"
;{
right = (right + 1);
}
if (a9 == "T"
or (a9 == "t"
;{
right = (right + 1);
}
if (a10 == "T"
or (a10 == "t"
;{
right = (right + 1);
}
if (right == 9){
passed = 1;
}
if (right == 10){
passed = 1;
}
if (passed == 1){
name_on_certificate.value == test_taker.value;
}
if (passed == 0){
prompt("You Failed and You must retake test. Hit cancel and refresh"
;
}
}
</script>
<tr>
<td width="618" height="32" colspan="3"><font face="Arial"><em><strong>ENTER YOUR NAME
HERE:</strong> </em><input type="text" name="test_taker" size="36"></font></td>
</tr>
test_taker is undefined.
here's the script. I can't tell what I'm doing wrong. It should be defined as the text form named test_taker
<script language="JAVASCRIPT">
function grading(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10){
var right = 0;
var passed = 0;
if (a1 == "T"
right = (right + 1);
}
if (a2 == "T"
right = (right + 1);
}
if (a3 == "F"
right = (right + 1);
}
if (a4 == "T"
right = (right + 1);
}
if (a5 == "F"
right = (right + 1);
}
if (a6 == "T"
right = (right + 1);
}
if (a7 == "T"
right = (right + 1);
}
if (a8 == "F"
right = (right + 1);
}
if (a9 == "T"
right = (right + 1);
}
if (a10 == "T"
right = (right + 1);
}
if (right == 9){
passed = 1;
}
if (right == 10){
passed = 1;
}
if (passed == 1){
name_on_certificate.value == test_taker.value;
}
if (passed == 0){
prompt("You Failed and You must retake test. Hit cancel and refresh"
}
}
</script>
<tr>
<td width="618" height="32" colspan="3"><font face="Arial"><em><strong>ENTER YOUR NAME
HERE:</strong> </em><input type="text" name="test_taker" size="36"></font></td>
</tr>