reading value attached to a variable in Javascript
<p>Hi below is a section of my code. I dont get the desired out put for <code>else if ( txt3Val.value &gt;= txt4Val )</code> but if I adjust it to <code>else if ( document.getElementById('txt3') &gt;= document.getElementById('txt4') )</code> it works. Can someone tell me why this happens? Thanks.</p>

<pre><code>......AND THE CODE READS
    else if(document.form1.GWchk.checked == true) 
        {
        var txt3Val = document.getElementById('txt3');
        var txt4Val = document.getElementById('txt4');
            if(txt3Val.value == "" || txt4Val.value == "")
            {
                alert ("You need to enter both starting and ending number \nof the cheque book for GlW."); return false;
            }
            else if ( txt3Val.value &gt;= txt4Val ) 
            { 
                alert ("Ending cheque number should be of greater value"); return false;
            }
            else
            {
            alert ("Successfully saved your entry1."); return false;
            }
        }
</code></pre>

<p><strong>HIGHLIGHT :</strong> Sorry the code <code>else if ( txt3Val.value &gt;= txt4Val.value )</code> also doesnt work! Actually that's what its there on my real script a re-write error here. But the my preoblem remains the same where it doesnt give me the ending number should be greate.... and straight goes to successfully saved.</p>

<p><strong>EDIT</strong> I think I figure out something. On the first text box if I put '10' as a value and second as '9' then JS seems doesn't recognize 9 as a lower value. But if I put '09' it gives the desired out put. How do I handle this?</p>
