<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. &nbsp;If the box has any other value, the script continues on to validate other form values. &nbsp;My current code is below. &nbsp;<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. &nbsp;It will not submit if any other number of characters are in the box. &nbsp;When the code is used in it&#8217;s current state, the form will submit no matter how many characters are in the box. &nbsp;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(&quot;Please enter a \&quot;First name\&quot;.&quot;);<BR>
theForm.dafn.focus();<BR>
return (false);<BR>
}<BR>
</FONT>
</BODY>
</HTML>