Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Justin OConnell on Apr 21, 2008 11:52
open dhtmlx forum
Combo getSelectedValue doesnt work after setComboValue

I am using the combo control on one of my pages. When i do a setComboValue() to populate the field, then later try to recall the value using getSelectedValue() nothing is returned, even though the value shows visually after it is set. Any ideas?

Thanks,
Justin
Answer posted by Support on Apr 22, 2008 02:08
The combo has two methods to get the current value

combo.getSelectedValue
combo.getActualValue

if you set new value , which has corresponding option - both method will return it
if you set new value, which has not corresponding option - getActualValue will return it, getSelectedValue will not return it ( because there was no any option selected )

Basically you can use combo.getActualValue()  -  it will work as expected in your case