Best way to access form input values
<p>I have the following two variables.  I will send the data variable to the server, and upon return, want to access the various original values.</p>

<p>I could do some sort of eq(1).val() approach to either the data or raw variable, but then need to make sure I am accessing them in the right order which might result in future maintenance issues.  Or I can get the values from the original DOM using the name selector, but it seems like I am doing the work twice.  Or I can add IDs as well as names to the original form, but that seems like a waste.</p>

<p>Ideally, I would be able to convert the form's name/value to some sort of object, but unlike serializeArray would not make an array, but have the value directed tied to the name.  For instance, if my form had <code>&lt;input name="foo" value="bar"&gt;</code>, I would be able to access the value as newObject.foo.</p>

<p>Any suggestions on the best way to do this?  Thank you</p>

<pre><code>var raw=$("#form_id").find('input,select');
var data=raw.serializeArray();
</code></pre>
