6 Replies Latest reply on Feb 3, 2008 8:50 PM by pennsyfan

    If statements with parameters

    pennsyfan
      I am trying to evaluate thre fields for null or empty string values.

      If first name is blank or null set display text = to "first name is required"
      set focus to first name

      if first name is not blank or null and last name is blank or null set display text ="last name is required"
      set focus to last name

      if first name and last name is not blank or null and emailaddress is blank or null then set display text =
      "email address is required"
      set focus to email address

      I can get the fist two to work, but cannot seem to get the third one to work.

      here is the code, any suggestions?

      Thanks

      Jim

      if (billFname_txt.text == null || billFname_txt.text == ''){
      errorText_txt.text = "Please enter your first name"
      focusManager.setFocus(billFname_txt);
      return
      }
      if (!(billFname_txt.text == null || billFname_txt.text == '')
      &&( billLname_txt.text == null || billLname_txt.text == ''))
      errorText_txt.text = "Please enter your last name"
      focusManager.setFocus(billLname_txt);
      return
      }

      if (!(billFname_txt.text == null || billFname_txt.text == '')
      &&(!( billLname_txt.text == null || billLname_txt.text == ''))
      &&( billEmail_txt.text == null || billEmail_txt.text == ''))
      errorText_txt.text = "Please enter your email address"
      focusManager.setFocus(billEmail_txt);
      return