Passing variable to input in pop-up window with jquery
<p>Guyz, I've a weird situation: I need to pre-compile input field when visitor opens a pop-up window by clicking on the button.</p>

<p>See here: <a href="http://www.ageditalia.it/" rel="nofollow">http://www.ageditalia.it/</a> in the header click on a little banner that says email and password. Pop-up will jump out. I need these password and email written on the banner to be inserted with jquery automatically.</p>

<p>I tried this:</p>

<pre><code>$("a:.loginonthefly-open").click(function (event) {
    $("#auth_username").blur(function()
    {
        if ($(this).val() == "")
        {
             $(this).val("haha");
        }
    });
    $("#auth_username").blur();
});
</code></pre>

<p>but field input gets cleared, I see my haha text for few seconds and than it disappears.</p>

<p>I don't understand what is going on,</p>

<p>Any help appreciated!</p>

<p>EDIT:
So far I got this, it works only on the second click when html is inserted in dom. Doesnt work on first click on fresh page load!</p>

<pre><code>$("a:.loginonthefly-open").click(function (event) {
if($("#auth_username").val() == "") {
$("#auth_username").delay(200).queue(function(){
$("#auth_username").val("TEST");
});
}
});
</code></pre>

<p>How do I make it work on first load?</p>

<p>Obviously I need a better handler than click. any thoughts?</p>
