Hello,
It needs to have the "selected" in the option to be sync. The basic structure is this.
<select onChange='somefunction()'>
<option value=1 > one </option>
<option value=2 selected > two </option>
<option value=3 > three </option>
</select>
I used the loop to to write the selected into correct option (and not to write tens of times the same code)
Here is an example without any loops.
//Simple Select example
var s="";
s+="<select onChange='mango.view.setPoint("+ point.id +", \""+ pointComponent.id +"\", this.options[this.selectedIndex].value )'>";
s+= "<option value=1";
if (value == 1 ) { s+= " selected ";}
s+= "> one </option>";
s+= "<option value=2";
if (value == 2 ) { s+= " selected ";}
s+= "> two </option>";
s+= "<option value=3";
if (value == 3 ) { s+= " selected ";}
s+= "> three </option>";
s+= "<option value=4";
if (value == 4 ) { s+= " selected ";}
s+= "> four </option>";
s+="</select>";
return s;
I will put some more select examples from my views into the other topic.
BR
-Jokke