I have a form containing a list of text fields
<input type="text" name="list[]" value="">
<input type="text" name="list[]" value="">
I'm running some custom jQuery to validate the input and do a few other things, before displaying a JSON chunk to the user. What I want to achieve is these elements should become a standard javascript array a la:
{"list":["something","something else"]}
Is there a simple call I can make on the specific element to pull it in as an array, something like this?
var jsonVars = {};
jsonVars['list'] = $("input[name=list]").getArray();