document.getElementById not working inside function
<p>I am getting a strange problem while using <code>document.getElementById</code> inside a function.
I have a form in modal window (<a href="http://highslide.com/" rel="nofollow">Highslide</a>). While the form is submitting, I am just calling function foo.Inside foo I am just selecting form elements by ID using <code>document.getElementById</code>. But doesn't present value, just returns default value.
I tried jQuery html but it doesn't work.</p>

<p>My code</p>

<pre><code>function foo(){
    var name = document.getElementById('yname').value; 
    // it just returns default value(null).
} 

&lt;form onsubmit="return foo();"&gt;.......&lt;/form&gt;
</code></pre>

<p>These things are happening in Wordpress theme.</p>

<p><a href="http://cratecreative.com/kosherwedding/abigaels/" rel="nofollow">Working location</a></p>

<p><a href="http://awesomescreenshot.com/020fnvie5" rel="nofollow">Modal form is existing here</a>   </p>
