Todd MacPherson
asked on
My if else statement is not working. Please help me fix it.
Hi Experts
I am a complete noob to javascript but I have been tinkering with it and trying to refine a popup menu script. Please look at the else if statement at the bottom. No matter what I select from the popup menu the value that is returned is always 'N/A' Please help me fix this.
Thanks
PBLack
I am a complete noob to javascript but I have been tinkering with it and trying to refine a popup menu script. Please look at the else if statement at the bottom. No matter what I select from the popup menu the value that is returned is always 'N/A' Please help me fix this.
Thanks
PBLack
var aHazard = ["Severity and Probability",["1. Imminent Danger","1A Probable","1B Reasonably Probable","1C Remote","1D Extremely Remote"],["2. Serious","2A Probable","2B Reasonably Probable","2C Remote","2D Extremely Remote"],["3. Minor","3A Probable","3B Reasonably Probable","3C Remote","3D Extremely Remote"],"4. N/A"];
var cRtn = app.popUpMenu(aHazard);
if(cRtn != null)
if(cRtn = "4. N/A") {
this.getField("PreTxt1").value = "N/A"
}else{
this.getField("PreTxt1").value = cRtn.substring(0,2)}
ASKER
Just learning dude. I will try and get right back.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Not working. It is still returning a value of N/A no matter what I choose from the popup menu.
ASKER
Opps never saw the other comments before that last comment from me. Hold on while I try
ASKER
Works perfectly. Thanks guys.
Why dont you indent and give proper parenthesis?
try this-
Open in new window