cancel
Showing results for 
Search instead for 
Did you mean: 

Drop down List

pbechani
Participant
0 Kudos

Hi

I have a drop down list(DDL) control on my form. Im trying to read the selected value. I have put code on the change event. Strange enough, when the event is triggered it returns previous value in the rawValue attribute. I want to read the current value. If I use the same code in the calculate event, it works but returns an error that the validation has failed.

The code i am using is

if (this.rawValue != "No Damage") {

damage.presence = "visible";

}

else {

damage.presence = "hidden";

}

where damage is the name of a subform whose visibility is determined by the value in the DDL. Is there something i'm missing here?

Regards

Accepted Solutions (1)

Accepted Solutions (1)

chintan_virani
Active Contributor
0 Kudos

Prince,

Just make sure you have selected the language as JavaScript and try your code in the exit event or else try code as shown below in change event as getting current value from drop-down is different from other controls.

xfa.host.messageBox("Current Value is " + xfa.event.change);

OR

xfa.host.messageBox("Current Value is " + xfa.event.newText);

Use anyone which works best for you.

Chintan

pbechani
Participant
0 Kudos

Hi Chintan

Thank you very much. The Exit event really worked for me.

I had to make one small modification on your javascript. I used

xfa.host.messageBox(" The value is : " + this.rawValue);

Regards

Answers (0)