Expand my Community achievements bar.

multiple field values to be populated in a drop down box

Avatar

Former Community Member

Hi

I am wanting to get the value of about 6 text boxes and create a drop down box from this information.  Is there a simple code for this??

michelle

4 Replies

Avatar

Level 9

Yes, it's quite possible. But in which event of which Field you want to have the code?

Thanks,

Bibhu.

Avatar

Level 4

You can use the below code on button's click event

 

DropDownList1.addItem(TextField1.rawValue);

DropDownList1.addItem(TextField2.rawValue);

DropDownList1.addItem(TextField3.rawValue);

DropDownList1.addItem(TextField4.rawValue);

DropDownList1.addItem(TextField5.rawValue);

DropDownList1.addItem(TextField6.rawValue);

Thanks,

Vipin

Avatar

Former Community Member

HI Vipin

I have this partly working. I have put this in a repeatable row in a table so the textfield always has the same name how do I get around this

thanks

michelle

Avatar

Level 9

Hi Michelle,

In that case you need to loop through all instances of the Row. Then put the script as follows.

var count = Row1.instanceManager.count;

for (var i=0;i<=count;i++)

     {

          DropDownList1.addItem(TextField1['"+  i + "].rawValue);

     }

Thanks,

Bibhu.