ASP.NET (35) SQL (25) JAVASCRIPT (24) HTML (14) STYLE SHEET (6) ASP (4) SCRIPT (1)

Search me out HERE!!

To Fetch FORM Element value directly in JAVASCRIPT

Below example show how to fetch Form Element value directly in Javascript without use of Document.form

JAVASCRIPT:
<script language="javascript">
function checkTestForm()
{
    with (window.document.frmTest)
    {
        alert(txtPrice.value);       
    }
   
}

</script>

HTML CODE:
<form id="frmTest" name="frmTest" method="post">
<input type="text" id="txtPrice" name="txtPrice" />
<input type="button" id="btn" name="btn"  value="OK"   onclick="return checkTestForm();" />
</form>

No comments:

Post a Comment