Why does jQuery not update the input value with $("form :input[name="some_input"]).val();
<p>I'm trying to create a dual login script that logs a user into two separate systems (form a &amp; form b) from another separate login (dual).</p>

<pre><code>&lt;h2&gt;Dual Login&lt;/h2&gt;
    &lt;form id="dual"&gt;
    username&lt;br&gt;
    &lt;input type="input" name="un" value="1234567"&gt;&lt;br&gt;
    password&lt;br&gt;&lt;input type="password" name="password"&gt;&lt;br&gt;
    &lt;input type="submit" name="submit"&gt;
&lt;/form&gt;

&lt;h2&gt;Login A&lt;/h2&gt;
&lt;form id="login_a" action="#" method="post"&gt;
    username&lt;br&gt;
    &lt;input id="un_a" type="input" name="un_a" value="hi"&gt;&lt;br&gt;
    password&lt;br&gt;
    &lt;input id="pw_a" type="password" name="pw_a"&gt;&lt;br&gt;
    &lt;input type="submit" name="submit"&gt;
&lt;/form&gt;

&lt;h2&gt;Login B&lt;/h2&gt;
&lt;form id="login_b" method="post" action="#"&gt;
    username 1&lt;br&gt;
    &lt;input id="un_b" type="text" name="un_b" value=""&gt;&lt;br&gt;
    password&lt;br&gt;
    &lt;input id="pw_b" type="password" name="pw_b"&gt;&lt;br&gt;
    &lt;input type="submit"&gt;
&lt;/form&gt;
</code></pre>

<p>Here is the jQuery:</p>

<pre><code>$('#dual :input[name="un"]').blur(function(){
    un = $('#dual :input[name="un"]').val();
    $('#un_a').val(un);
    $('#un_b').val(un);
});
</code></pre>

<p>Here is a fiddle that illustrates the working example:</p>

<p><a href="http://jsfiddle.net/mckinselberg/bPapQ/" rel="nofollow">http://jsfiddle.net/mckinselberg/bPapQ/</a></p>

<p>My question is: Why is it that when I try to update the values this way, it doesn't work:</p>

<pre><code>$('#dual :input[name="un"]').blur(function(){
    un = $('#dual :input[name="un"]').val();
    $('#form_a :input[name="un_a"]').val(un);
    $('#form_b :input[name="un_b"]').val(un);
});
</code></pre>

<p>Here is a fiddle that illustrates the non-working example:</p>

<p><a href="http://jsfiddle.net/mckinselberg/BbKTG/" rel="nofollow">http://jsfiddle.net/mckinselberg/BbKTG/</a></p>
