<HTML>
<HEAD>
<TITLE>If else statement help</TITLE>
</HEAD>
<BODY>
<FONT FACE="Verdana">Hello All,<BR>
<BR>
I am trying to get a form to submit if a text box has a value of 4,5, or 8 characters. If the box has any other value, the script continues on to validate other form values. My current code is below. <BR>
<BR>
If I take away the or value=5 and or value=8, the form will submit if 4 characters are in the box. It will not submit if any other number of characters are in the box. When the code is used in it’s current state, the form will submit no matter how many characters are in the box. What is the proper way to ask if a box value is equal to 4,5, or 8 please submit?<BR>
<BR>
Thanks,<BR>
Simeon <BR>
<BR>
<BR>
if (theForm.rn.value.length == 4) || (theForm.rn.value.length == 5) || (theForm.rn.value.length == 8) {return (true);}<BR>
else<BR>
{<BR>
alert("Please enter a \"First name\".");<BR>
theForm.dafn.focus();<BR>
return (false);<BR>
}<BR>
</FONT>
</BODY>
</HTML>