S
Steve
Hi everyone,
I have a test page. When I press the button, it bring form.html,
which is fine.
When I press Enter key in the textbox, it gives me an error saying
this.form.cmd is not an object. But in the button, it used the code
this.form.cmd.value='dispense'. Why does it give me the error? I
think in a function, it should recognize the document, form and its
objects, should it?
Thank a lot.
Here is the page.
<form name="newRxForm" method="post" action="form.html">
<input type="hidden" name="cmd" value="dispense">
<script language='javascript1.2' >
function microsoftKeyPress(upc) {
if (window.event.keyCode == 13){
this.form.cmd.value="view";
f.submit();
}}
</script>
<input type="text" name="upc" value="upc"
onKeyPress="microsoftKeyPress(this.value)">
<input type="button" name="Submit3" value="Dispense" class="smallText"
onClick="this.form.cmd.value='dispense';this.form.submit()">
</form>
I have a test page. When I press the button, it bring form.html,
which is fine.
When I press Enter key in the textbox, it gives me an error saying
this.form.cmd is not an object. But in the button, it used the code
this.form.cmd.value='dispense'. Why does it give me the error? I
think in a function, it should recognize the document, form and its
objects, should it?
Thank a lot.
Here is the page.
<form name="newRxForm" method="post" action="form.html">
<input type="hidden" name="cmd" value="dispense">
<script language='javascript1.2' >
function microsoftKeyPress(upc) {
if (window.event.keyCode == 13){
this.form.cmd.value="view";
f.submit();
}}
</script>
<input type="text" name="upc" value="upc"
onKeyPress="microsoftKeyPress(this.value)">
<input type="button" name="Submit3" value="Dispense" class="smallText"
onClick="this.form.cmd.value='dispense';this.form.submit()">
</form>