You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How could form2js build the following JSON for me?
{person: {favFood: []}}
One solution would be to cast a set of square brackets to an empty list. Then you could initialize any list you want to be empty by adding a hidden input as follows:
This can be achieved by using the nodeCallback option:
nodeCallback:function(node){varname=node.getAttribute ? node.getAttribute('name') : null;// if the node is named and has the value "[]"if(name&&node.value==="[]")return{name: name,value: []};// change value to empty arrayreturnfalse;}
Still wish I didn't have to add the hidden field...
Given the following unselected inputs:
How could form2js build the following JSON for me?
One solution would be to cast a set of square brackets to an empty list. Then you could initialize any list you want to be empty by adding a hidden input as follows:
Any other ideas?
The text was updated successfully, but these errors were encountered: