I am creating a text box that will auto fill based on certain conditions. In this example, I would like a certain message to appear if US selected from my dropdown. If UK is selected, I would like the first message to dissapear and have a second message appear. Vice versa if the user selects UK, then US.
Here is the script:
Change Event for the dropdown
var oldV = txtVar.rawValue;
if(xfa.event.newText == "US"){
txtReminder.rawValue = oldV + "\n ALERT #1."}
else{txtReminder.rawValue = oldV;}
var oldV = txtVar.rawValue;
if(xfa.event.newText == "UK"){
txtReminder.rawValue = oldV + "\n ALERT #2."}
else{txtReminder.rawValue = oldV;}
Form:ready Event for the dropdown
txtReminder.rawValue = txtVar.rawValue;
Initialize Event for txtVar
this.rawValue = txtReminder.rawValue
Everytime UK is selected in my dropdown, "ALERT #2" appears, and then disappears if another option is selected (this is exactly what I want). However, nothing happens when US is selected. When I delete the second script block (the UK one), the US selection now works. Please advise on how I can get both to work.
txtReminder is the text box that is being modified
txtVar is a hidden text box.
Let me know if this requires anymore clarification, Thanks!!