Expand my Community achievements bar.

SOLVED

Drop down value displays in another text field

Avatar

Level 7

Hello - I found this script in the Forum, but I'm not able to get it

to work. I have the script in the change event of the drop down field. Whatever is chosen in the ddl, should then appear in TextField12. The ddl works fine, but the value selected is not displaying in the text field on page 4.

if

(xfa.event.fullText == "Supervisor")

{

page4.pcEquip.dirAbove.TextField12.rawValue

= "Supervisor";

}

if

(xfa.event.fullText == "Manager")

{

page4.pcEquip.dirAbove.TextField12.rawValue

= "Manager";

}

if

(xfa.event.fullText == "Director")

{

page4.pcEquip.dirAbove.TextField12.rawValue

= "Director";

}

if

(xfa.event.fullText == "VP")

{

page4.pcEquip.dirAbove.TextField12.rawValue

= "VP";

}

else

{

page4.pcEquip.dirAbove.TextField12.rawValue

= null;

}

Any help is appreciated.

Thanks,

MDawn

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

I would use generic code like follwing.....in change event of DD...

if

(xfa.event.change != "Please Select") { //when any thing other than 'Please Select'

     page4.pcEquip.dirAbove.TextField12.rawValue

= xfa.event.change; //assign current selected value to text field.

}

else { //when 'Please Select'

     page4.pcEquip.dirAbove.TextField12.rawValue

= ""; //clear the TextField value

}

Good luck

View solution in original post

2 Replies

Avatar

Correct answer by
Former Community Member

I would use generic code like follwing.....in change event of DD...

if

(xfa.event.change != "Please Select") { //when any thing other than 'Please Select'

     page4.pcEquip.dirAbove.TextField12.rawValue

= xfa.event.change; //assign current selected value to text field.

}

else { //when 'Please Select'

     page4.pcEquip.dirAbove.TextField12.rawValue

= ""; //clear the TextField value

}

Good luck

The following has evaluated to null or missing: ==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5] ----