Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Steve Wyatt on Feb 25, 2008 11:08
open dhtmlx forum
Combo attributes (id, class, name)

We are using the combo to replace an existing html text input. We use the input id, class and name attributes in existing javascript functions that use getElementById, getElementByClass and getElementsByName. I have been able to set the id and class by referencing combo.DOMelem_input, but I am having trouble setting the name attribute.

I call:

combo.DOMelem_input.name = 'MyName';

The name field chages on the DOMelem_input but the html input element name attribute does not appear.

Given that this is sort of a hack into the dhtmlxcomblo, I am wanting to know whether it is acceptable to set these attributes and if so, why doesn't the name attribute value change?

Answer posted by Support on Feb 26, 2008 05:58
Setting custom attributes in mentioned way will not break any existing functionality, such attributes as "id","name","class" - never reset after initial creating.
Please beware that combo code created a hidden field with name set as second parameter of combo , so if you will try to use the same name for visible input - it may not work as expected.