Skip to main content
Known Participant
February 21, 2023
Answered

app.alert still shows after age is entered.

  • February 21, 2023
  • 1 reply
  • 650 views

Once a checkbox have been checked, an alert message will appear if the age field is empty. 

Click "OK", then setFocus on age field.

After I enter the age and click out of the age box, the message still appears another time, as if the value hasn't been committed yet.

How do I show the message only once?

 

if (getField("Run").value == "1")
{

if (this.getField("MaxHR").value == "")

app.alert("Please enter patient's age or Date of Birth!",3);

getField("age").setFocus();

}

}

 

This topic has been closed for replies.
Correct answer Nesa Nurani

You are using two different fields, "MaxHR" and "age". Even if you fill "age" field alert will pop as long as "MaxHR" is empty. Change "MaxHR" to "age".

1 reply

Nesa Nurani
Community Expert
Nesa NuraniCommunity ExpertCorrect answer
Community Expert
February 21, 2023

You are using two different fields, "MaxHR" and "age". Even if you fill "age" field alert will pop as long as "MaxHR" is empty. Change "MaxHR" to "age".

yeungyamAuthor
Known Participant
February 21, 2023

How silly of me.