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.v alue='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.ht ml">
<input type="hidden" name="cmd" value="dispense ">
<script language='javas cript1.2' >
function microsoftKeyPre ss(upc) {
if (window.event.k eyCode == 13){
this.form.cmd.v alue="view";
f.submit();
}}
</script>
<input type="text" name="upc" value="upc"
onKeyPress="mic rosoftKeyPress( this.value)">
<input type="button" name="Submit3" value="Dispense " class="smallTex t"
onClick="this.f orm.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.v alue='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.ht ml">
<input type="hidden" name="cmd" value="dispense ">
<script language='javas cript1.2' >
function microsoftKeyPre ss(upc) {
if (window.event.k eyCode == 13){
this.form.cmd.v alue="view";
f.submit();
}}
</script>
<input type="text" name="upc" value="upc"
onKeyPress="mic rosoftKeyPress( this.value)">
<input type="button" name="Submit3" value="Dispense " class="smallTex t"
onClick="this.f orm.cmd.value=' dispense';this. form.submit()">
</form>
Comment