endless loop on user input
I have the following code on a stateless form. The user enters a last name and an id. After entering the id this code is called to verify the record exists. It works correctly if the last name and id are found. If the record is not found the alert message is shown. But it goes into a loop at this point. The alert box is shown over and over again. Is there something I need to add to put focus on the last name fiield?
if ((count(NHS_Form[Last_Name == input.Last_Name]) > 0) && (count(NHS_Form[StudentID == input.Student_ID]) > 0))
{
NHS_Rec = NHS_Form [StudentID == input.Student_ID];
input.Email_1 = NHS_Rec.Email;
}
else
{
input.Student_ID = 0;
input.Last_Name = "";
alert("Last Name and ID mismatch");
}
Herb Wexler
www.PreventingMediocrity.com