endless loop on stateless form

endless loop on stateless form


I have the following code on a stateless form. The user enters a last name and an id. If a matching record is found the data is loaded into the stateless form. If not an alert box is shown. The problem is with the not found condition. It goes into an endless loop. I close the alert box and it pops back up. Do I need to set the focus back to the last name foield?


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