Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Niranjan Avadhuta on Mar 13, 2008 06:44
open dhtmlx forum
Accessing the combo box control after initialization

Thanks for your reply.

I wanted to know if it is possible to get the id of the combobox once it is converted to combo from select box. If the select control has id "select1", then once it is converted to combo using dhtmlxComboFromSelect('select1'), what would be new id of the combo box. Will it be the same 'select1' with some suffix or prefix, or is it entirely different? Is there any way to correlate the old id to new id?

The issue is that if I have thirty combo boxes on one screen, I can't maintain global variable (z in your example) for each and evey control. Depending on different conditions, I decide which combo to be used. Accessing by id (not by variable) would be the ideal solution. Is there any way?

Thanks,
Niranjan Avadhuta.

Answer posted by Support on Mar 13, 2008 08:03
The dhtmlxComboFromSelect method returns reference to the related combo object , which can be stored for further usage.
There is no way to access combo by ID of original selectbox, but if you need only combo value you still can access it by name of original selectbox

<select name="someA"
.....
var value=document.forms[0]["someA"].value;