Adding argument to form action using input type hidden
<p>How to add arguments in a form action using input type="hidden". 
My HTML snippet...</p>

<pre><code>&lt;form id="form1"&gt;
&lt;input type="text" name="txt"/&gt;
&lt;input type="hidden" name="usID" value=123/&gt;
&lt;input type="hidden" name="usname" value="name1"/&gt;
&lt;input type="submit" onclick="add()" value="ADD"/&gt;
&lt;/form&gt;
</code></pre>

<p>My JavaScript snippet...</p>

<pre><code>function add()
{
document.getElementsByName('usID').value=789;
document.getElementsByName('usname').value="name2";

document.getElementById('form1').action = "/page";
document.getElementById('form1').submit();
}   
</code></pre>

<p>After entering "text" in the textbox and pressing ADD, the link looks like this...
<a href="http://localhost:3000/page?txt=text&amp;usID=123&amp;usname=name1" rel="nofollow">http://localhost:3000/page?txt=text&amp;usID=123&amp;usname=name1</a></p>

<p>Why hasn't the usID and usname changed to 789 and "name2" respectively?
Any other alternative if not this?</p>