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