Explore the community Forums Lectora Lectora Questions & Answers Use variable in text for droplist Reply To: Use variable in text for droplist

#370742 Score: 2
Profile photo of Darrel Somoza
Darrel Somoza
Member
contributor
friend finder
beginner
intermediate
junior moderator
advanced
wise owl
curious george
profile
209 pts
@Klaatu

If I am understanding you correctly, you want to have a variable determine the value and text of an option in a drop down, correct? Yup, you can do it (with jQuery).

$(‘option:nth-child(1)’).attr(‘value’,VarVariable1.getValue()).text(VarVariable1.getValue());

This will change whatever the first option is (it doesn’t matter) to the value of variable1.

Darrel

This post has received 2 votes up.
Attachments:
  1. Change-Option.zip