I have 3 folders named 100020, 123440, and 456987 all contain a general.htm that starts a separate lesson for my pharmacy students. I have a single text box form with a submit button
The commented out function below works. I would now like be able to alert the student that they entered the wrong number. I tried variations of the code below but does not work. When I submit, the textbox clears and nothing happens.
Any help would be appreciated.
Code:
<form onsubmit="return handleThis(this)" name="patientfindform">
The commented out function below works. I would now like be able to alert the student that they entered the wrong number. I tried variations of the code below but does not work. When I submit, the textbox clears and nothing happens.
Any help would be appreciated.
Code:
function handleThis(formElm)
/*{
window.location="http://www.mywebsite.com/echart/"+formElm.patient_num.value+"/general.htm";
return false;
}
*/
if (formElm.patient_num.value = 100020)
{
window.location="http://www.mywebsite.com/echart/"+formElm.patient_num.value+"/general.htm";
}
else if (formElm.patient_num.value = 123440)
{
window.location="http://www.mywebsite.com/echart/"+formElm.patient_num.value+"/general.htm";
}
else if (formElm.patient_num.value = 456987)
{
window.location="http://www.mywebsite.com/echart/"+formElm.patient_num.value+"/general.htm";
}
else
{
alert("Patient ID not found");
}