Data in multiple fields conflicting each other in javascript
I have multiple fields to enter data. I am trying to VALIDATE that with results like ALERT and COLOR CHANGE in the same field where the data was entered. It is working fine up to certain range. But when the goes within the range of other field it is giving conflicting result.
Suppose I put the following in one field:
event.rc = true;
if (event.value >= "5" || event.value <= "10.0")
{
event.target.textColor = color.blue;
}
else
{
app.alert("The entered value is after lunch glucose and should be between '5.0' to '10.0'");
event.target.textColor = color.red;
}
And in another field I put:
event.rc = true;
if (event.value >= "90" || event.value <= "130.00" )
{
event.target.textColor = color.blue;
}
else
{
app.alert("The value is blood pressure SYS. If it goes higher than '130' you are in high blood pressure and if it goes lower than '90' you are in low blood pressure ");
event.target.textColor = color.red;
}
Thanks
