Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Anton Kuntsevich on May 20, 2009 07:51
open dhtmlx forum
dhtmlxCombo: complex names for grouping fields in forms

Hello!

I needed to group fields passing through form into arrays using the syntax with "[]":

<form ...>
<input type="text" name="arr1[name]"/>
...

<div id="dhtmlXCombo1"></div>
<script type="text/javascript">
var color_combo= new dhtmlxCombo("dhtmlXCombo1", "arr1[color]", 300);
</script>
</form>

But it doesn't work. Second hidden field's name becomes corrupted:

<input type="hidden" name="arr1[color]_new_value" value="false"/>

So the question: Is there a way to use such complex names?
Answer posted by Support on May 20, 2009 08:48
You can redefine name directly by using

var color_combo= new dhtmlxCombo("dhtmlXCombo1", "arr1[color]", 300);
color_combo.DOMelem_hidden_input2="arr1[color_new_value]"; // any field name here