I am using the Dojo Toolkit, and I want the form elements to be serialized into an array, something like this:
<div dojoType="dijit.form.Form" jsId="form"> <input dojoType="dijit.form.TextBox" name="id" type="text" value="1"></input> <input dojoType="dijit.form.TextBox" name="array[]" type="text" value="value1"></input> <input dojoType="dijit.form.TextBox" name="array[]" type="text" value="value2"></input> </div>
serialize:
{ "id" : 1, "array" : [ "value1", "value2" ] }
Is it possible?
By the way, I use dojo.toJson(form.get('value')) for serialization.
source share