I just took off "document." and changed the alert message syntax.  You might want to consider trimming whitespaces off the jobno field just in case but i'm lazy to write something :-D

<script LANGUAGE="_javascript_">

function _customValidation()
{
  if(form1.offtime.value == "Normal" && form1.jobno.value() == "" )

  {
    Alert("You must supply a value for either field_A
or field_B");
  }

}

</script>

  ----- Original Message -----
  From: Angel Stewart
  To: CF-Community
  Sent: Thursday, November 13, 2003 8:51 AM
  Subject: Qforms: Field required if selection box equals Normal.

  Hey guys and gals,

  I am using Qforms, and need to do a 'custom' validation.

  Basically, if the user selects Normal from the offtime select box, then
  they must enter a number in the JobNo text box.
  If they select anything else from the select box..they don't have to
  enter a JobNo.

  So far I have this _javascript_:

  <script LANGUAGE="_javascript_">

  function _customValidation()
  {
    if( document.form1.offtime.value == "Normal" &&
  document.form1.jobno.value() == "" )

    {
      obj.field_A.throwError("You must supply a value for either field_A
  or field_B");
    }

  }

  </script>

  But it doesn't work right :-\

  I don't know _javascript_..but I threw this together from looking at other
  code.

  Can anyone help?
  0_0

  -Gel


[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to