rchoppin
05-01-2003, 04:43 PM
:mad: This html:
<HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
function f_submit () {
alert ( 'f_submit' );
return;
}
function f_chg () {
alert ( 'f_chg' );
return;
}
</SCRIPT>
</HEAD>
<BODY >
<FORM NAME="act_form" ONSUBMIT="f_submit()" >
<INPUT TYPE="TEXT"
NAME="chg"
VALUE="25"
ONCHANGE="f_chg()"
>
<INPUT TYPE="TEXT"
NAME="chg2"
VALUE="25"
ONCHANGE="f_chg()"
>
</FORM>
</BODY>
invokes the f_sumit() function with
only the first input element
and the f_chg() function with both
input elements, if the value in
the first input element is changed.
questions:
a) is this standard browser behavior
(standards vs. microsoft); it doesn't work this way with netscape.
b) is there anyway to suppress the
submission (I tried to return false and it submits anyway).
c) in the case of two input elements,
changing the value and hiting the enter key rings a bell. You have to
tab to an new field or click on a new field to get the f_chg to invoke.
I've also tried adding another (hidden) input element.
<HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
function f_submit () {
alert ( 'f_submit' );
return;
}
function f_chg () {
alert ( 'f_chg' );
return;
}
</SCRIPT>
</HEAD>
<BODY >
<FORM NAME="act_form" ONSUBMIT="f_submit()" >
<INPUT TYPE="TEXT"
NAME="chg"
VALUE="25"
ONCHANGE="f_chg()"
>
<INPUT TYPE="TEXT"
NAME="chg2"
VALUE="25"
ONCHANGE="f_chg()"
>
</FORM>
</BODY>
invokes the f_sumit() function with
only the first input element
and the f_chg() function with both
input elements, if the value in
the first input element is changed.
questions:
a) is this standard browser behavior
(standards vs. microsoft); it doesn't work this way with netscape.
b) is there anyway to suppress the
submission (I tried to return false and it submits anyway).
c) in the case of two input elements,
changing the value and hiting the enter key rings a bell. You have to
tab to an new field or click on a new field to get the f_chg to invoke.
I've also tried adding another (hidden) input element.