put form elements all form elements into specific object array
<p><strong>UPDATED</strong>
How would I get all form elements from a form and format them in an object to match the output of the following object(using only javascript)?</p>

<pre><code>var feature = dojo.byId('searchString').value;

         var OBJECTID= dojo.byId('OBJECTID').value;
</code></pre>

<p><strong>This is the format I need:</strong></p>

<pre><code>var updates = {attributes:{
          OBJECTID:OBJECTID,
          SubWS:feature
        }};
</code></pre>

<p><strong>form elements:</strong></p>

<pre><code>&lt;input type="text" id="OBJECTID" value="" /&gt;
&lt;input type="text" id="searchString" value="" /&gt;
</code></pre>

<p>output: <img src="http://i.stack.imgur.com/qHZjB.jpg" alt="enter image description here"></p>

<p>This is my working script, but the output does not match the above "updates". The final version will loop through many more form fields that will sometimes be updated, so i don't want to hardcode the attributes.  </p>

<pre><code> var inputs = document.getElementsByTagName("input");
      console.log("inputs array", inputs);
var params = {attributes:{}};
for(var i=0; i &lt; inputs.length; i++){
    var curr = inputs[i];
    if(curr.getAttribute('type')==='text'){
        params[curr.getAttribute('name')] = curr.value;
    }
}
</code></pre>

<p>this is what it looks like on my actual form.  As you can see the object is slightly different.
<img src="http://i.stack.imgur.com/rj84O.jpg" alt="enter image description here"></p>
