A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: if ( OR )

  1. #1
    Senior Member
    Join Date
    May 2002
    Posts
    153

    if ( OR )

    i have an if statement to check if either of 2 inout boxes has data in them:

    if(this.TextBox1.text != "" or this.TextBox2.text !=""){

    ... do stuff

    but if i enter data in textBox1 the OR clause doesn't trigger (so my syntax must be wrong, i suppose)

    any comments / fixes are appreciated
    jose gonzalez

  2. #2
    Senior Member
    Join Date
    May 2002
    Posts
    153

    got it

    sorry peeps

    i see now it needs to be && and not ||
    jose gonzalez

  3. #3
    FK's Giant Steve_w_V's Avatar
    Join Date
    Mar 2003
    Location
    San Jose, California
    Posts
    2,113
    Not necessarily. Try this:

    code:
    if (textBox.text != "desired text" || textbox.text != "other desired test") {
    //actions here
    } else {
    //not necessary but in case you need an "else"
    }

    The other day, I bought a box of animal crackers. On the side, it said "Do Not Eat if Seal is Broken". I opened the box and sure enough...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center