A
Alonso
Hello everybody! :-D
I am trying to validate a select object in a form. It does not work fine
in Explorer 6.0 because it always send the form, but in Netscape 7.0 it
works really fine. The code is below:
//----------------------------------------------------------------------
<head>
<script >
function validate()
{
if( document.results.p1.value=="1"
alert('Value not valid')
else
document.results.submit()
}
</script>
</head>
<FORM name=result action="page.php" method=post>
<TABLE cellSpacing=0 cellPadding=0 align=center>
.....
.....
<TR>
<TD align=center>
<select name=p1 id=p1>
<option selected>1</option>
<option>X</option>
<option>2</option>
</select>
</TD>
</TR>
.....
.....
.....
.....
<TR class="style">
<TD align=center>
<INPUT type=button value="Send" name=Submit onclick="validate()">
</TD>
</TR>
</table>
</form>
//----------------------------------------------------------------------
I think it's very very very strange. Isn't it? :?
Any ideas, plese?
Thanks!!!
I am trying to validate a select object in a form. It does not work fine
in Explorer 6.0 because it always send the form, but in Netscape 7.0 it
works really fine. The code is below:
//----------------------------------------------------------------------
<head>
<script >
function validate()
{
if( document.results.p1.value=="1"
alert('Value not valid')
else
document.results.submit()
}
</script>
</head>
<FORM name=result action="page.php" method=post>
<TABLE cellSpacing=0 cellPadding=0 align=center>
.....
.....
<TR>
<TD align=center>
<select name=p1 id=p1>
<option selected>1</option>
<option>X</option>
<option>2</option>
</select>
</TD>
</TR>
.....
.....
.....
.....
<TR class="style">
<TD align=center>
<INPUT type=button value="Send" name=Submit onclick="validate()">
</TD>
</TR>
</table>
</form>
//----------------------------------------------------------------------
I think it's very very very strange. Isn't it? :?
Any ideas, plese?
Thanks!!!