[thelist] Javascript if...or statement

Chris Blessing webguy at mail.rit.edu
Fri Aug 30 10:12:01 CDT 2002


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

> <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>
>
> I think this must be an improper use of the logical "or".  Can
> someone advise me as to the correct way to do this?




More information about the thelist mailing list