Expand my Community achievements bar.

Learn about Edge Delivery Services in upcoming GEM session

A glitch in my use of the change event

Avatar

Former Community Member
I have a script in the change event of a drop down list field that works when a certain choice is made then another field becomes visible. I am trying to get that field to become visible when when a record from a database populates the field the correct value. Right now all that happens is the drop down field shows the correct value but the field in question isn't visible.



Here is the code I am using for the change event.



var contractLangs = xfa.event.newText;

if (contractLangs == "Creative Works Unlimited")

{

xfa.form.form1.MainPageSF.ContractSF.ContractLanguageSF.presence = "visible";

}

else

{

xfa.form.form1.MainPageSF.ContractSF.ContractLanguageSF.presence = "hidden";

}



I can't figure out how to get the field to become visible when right value goes into the drop down field.
2 Replies

Avatar

Former Community Member
I thought that when ever the text in the drop changes the hidden field would become visible which is what happens when the user makes a selection. But it seems that even though the value in the drop down changes from getting a record in a database it's not the same thing.

Avatar

Former Community Member
I don't think I have been explaining this very well so here is another try.



I have a Drop-down List called "ContractTypeList" that has three items in the list;

Limited Permission

Creative Works Unlimited

Commission for Creative Works



If Creative Works Unlimited is chosen a hidden Drop-down List called "ContractLanguageList" becomes visible otherwise if either of the other two are chosen then it is hidden.



I would like the "ContractLanguageList" to be hidden or shown depending on which item shows in the Drop-down List when I cycle through records in a database. Right now it only works with user interaction.



I'm not sure what to do. I have been using the line, xfa.even.newText. If anyone can help me out it would most appreciated.