Skip to Content
0
Former Member
Mar 25, 2010 at 12:15 PM

Set initial selected value in dropdown list

186 Views

Hi guys!

A really frequent asked question but I didn't find my answer in all posts around it.

I need to set initial value selected in a dropdown list amoung all entry in this list.

For tis i used context mapping with a 0,n node. I get all my values in the list. I also have a single attribute that hold the initial value to compare with and I wrote the following script at form:ready event of my listbox :

this.selectedIndex = -1;
for (var i = 0; i < this.length; i++)
{
if (this.getSaveItem(i) == $record.attr1.value)
	this.setItemState(i,true) = i;
}

And of course nothing happens (or it wouldn't be fun...)!!

Really need your help to get the default selecteded value back from db data.