Avatar

Level 3

Yea, I guess the split function is what I am looking for. I'm not exactly sure where to utilize it in my code, so here is the sample code that I am using, maybe you can help me from there:

Change Event for the first dropdown:

if(xfa.event.newText == "Choice 1"){

var oldV = txtVar.rawValue
txtReminder.rawValue = oldV + "\n Display Sentence 1"

txtVar2.rawValue = txtReminder.rawValue;

}

else if(xfa.event.newText == "Choice 2"){

var oldV = txtVar.rawValue
txtReminder.rawValue = oldV + "\n Display Sentence 2"

txtVar2.rawValue = txtReminder.rawValue;

}

else if(xfa.event.newText == "Choice 3"){

var oldV = txtVar.rawValue
txtReminder.rawValue = oldV + "\n Display Sentence 3"

txtVar2.rawValue = txtReminder.rawValue;

}

else if(xfa.event.newText == "Choice 4"){

var oldV = txtVar.rawValue
txtReminder.rawValue = oldV + "\n Display Sentence 4"

txtVar2.rawValue = txtReminder.rawValue;

}

else if(xfa.event.newText == "Choice 5"){

var oldV = txtVar.rawValue
txtReminder.rawValue = oldV + "\n Display Sentence 6"

txtVar2.rawValue = txtReminder.rawValue;

}

else{

var oldV = txtVar.rawValue
txtReminder.rawValue = oldV;

Change Event for the second dropdown:

if(xfa.event.newText == "Choice 6" {

     var oldV2 = txtVar2.rawValue

     txtReminder.rawValue = oldV2 + "\n Display Choice 6"  

     txtVar.rawValue = txtReminder.rawValue;

     var oldV = txtVar.rawValue

     }

else {

     var oldV2 = txtVar2.rawValue

     txtReminder.rawValue = oldV2

     }

I scaled down the code to make this simpler. I tried to use the split function but had no luck. Perhaps I am using the code incorrectly, or inserting it in the wrong place? Please advise, thanks!