L
lmeng
Hi,
I am new to this Forum. Thanks in advance for any kind help.
In the following HTML code, when I change the value of one text field
then click "Modify" button, if the validation fails a message will
popup and the cotent of the form should NOT be submitted. (The actual
code connects to the database at the backend so I can check if the
value is submmited).
It works well in IE6.0 and Netscape 4.75.
But in Netscape 7.1, if the validation fails, the message pop up but
the form submit still go through. In another word, the return from JS
function inRangeInteger(), which is triggered by onChange event of the
text field, is ignored when the form submit.
Anything special in Netscape 7.1 for handling Javascript?
Any response is highly appriciated.
**************************************
function inRangeInteger(myField, minValue, maxValue)
{
var iValue;
var message;
iValue = parseInt(myField.value);
if ( (iValue >= parseInt(minValue)) && (iValue <= parseInt(maxValue))
)
{
return (true);
}
else
{
message = "You have entered an invalid value. Please re-enter an
integer value";
}
alert(message);
myField.focus();
return (false);
}
<FORM NAME="pbscConfig" METHOD="POST">
<input type="TEXT" name="text1" onChange="inRangeInteger(this, '1',
'60')">
<input type="TEXT" name="text2" onChange="inRangeInteger(this, '1',
'23')">
....
<input TYPE="SUBMIT" NAME="modifyPbsc" VALUE="MODIFY" >
</FORM>
*********************************************
I am new to this Forum. Thanks in advance for any kind help.
In the following HTML code, when I change the value of one text field
then click "Modify" button, if the validation fails a message will
popup and the cotent of the form should NOT be submitted. (The actual
code connects to the database at the backend so I can check if the
value is submmited).
It works well in IE6.0 and Netscape 4.75.
But in Netscape 7.1, if the validation fails, the message pop up but
the form submit still go through. In another word, the return from JS
function inRangeInteger(), which is triggered by onChange event of the
text field, is ignored when the form submit.
Anything special in Netscape 7.1 for handling Javascript?
Any response is highly appriciated.
**************************************
function inRangeInteger(myField, minValue, maxValue)
{
var iValue;
var message;
iValue = parseInt(myField.value);
if ( (iValue >= parseInt(minValue)) && (iValue <= parseInt(maxValue))
)
{
return (true);
}
else
{
message = "You have entered an invalid value. Please re-enter an
integer value";
}
alert(message);
myField.focus();
return (false);
}
<FORM NAME="pbscConfig" METHOD="POST">
<input type="TEXT" name="text1" onChange="inRangeInteger(this, '1',
'60')">
<input type="TEXT" name="text2" onChange="inRangeInteger(this, '1',
'23')">
....
<input TYPE="SUBMIT" NAME="modifyPbsc" VALUE="MODIFY" >
</FORM>
*********************************************