[thelist] Javascript if...or statement

Stephen Caudill SCaudill at municode.com
Fri Aug 30 11:13:01 CDT 2002


Thanks Chris, that kills the error but it still requires both be selected, rather than one or the other.  Any ideas on that?

Stephen Caudill
Web Designer
Municipal Code Corporation
www.municode.com
www.mccimaging.com


Stephen, you simply need to enclose the entire conditional in parenthesis as
such:

> <script type="text/javascript">
> function checksubmit()
> {
>       if(
> 	  (document.Job.VersionType.value == "")
> 	  ||
> 	  (document.Job.LFproduct.value == "")
>	  )
>    {
>       alert("Please select a Version or Plug-In")
>       document.Form.VersionType.focus()
>       return false
>    }
>    return true
> }
> </script>

Note the "(" after "if" and the ")" before the "{". HTH!

Chris Blessing
webguy at mail.rit.edu
http://www.330i.net



More information about the thelist mailing list