A Flash Developer Resource Site

Results 1 to 13 of 13

Thread: if (textfield blank) {???

  1. #1
    Junior Member
    Join Date
    Jan 2003
    Posts
    10

    if (textfield blank) {???

    howdy all,

    Just wondering... I'm organizing a PHP mailform and I want to check to see if some input textfields are blank... I dunno what my problem is.

    Here's the code:

    - - - - - - - - - - - - - - - - - - - -
    on (release) {
    if (email == "") {
    email_alert.gotoAndPlay (2);
    }
    }
    - - - - - - - - - - - - - - - - - - - -

    "email" being the name of the text field. All I want to happen is if the text field is blank.. do something.

    Any help would be greatly appreciated.

    Cheers,

    gc

  2. #2
    Junior Member
    Join Date
    Jan 2003
    Posts
    10
    Bueler?....... Bueler?......

  3. #3
    -Iron Myk- mykrob's Avatar
    Join Date
    Dec 2001
    Location
    Jackson, TN
    Posts
    1,356
    the code looks okay to me, you may just double check the target path, thats all i can figure. I'm assuimg the "email" variable is inside some instance, or at least the main timeline, so maybe the actionscript is looking for the variable, but not in the right place...and since its not there, the rest of the code cant execute...
    -myk
    "MOO"

  4. #4
    Junior Member
    Join Date
    Jan 2003
    Posts
    10
    mmm... thanks, that's not it though...

    if i type if blah blah blah == "a" then type "a" in the email field it works fine... it just won't test successfully for no input at all.

    i'm stumped...

  5. #5
    Member
    Join Date
    Mar 2001
    Posts
    66
    Is it an input text box? Dynamic? I dunno... maybe play with that.
    the legend that is...

  6. #6
    The Definition of... Urbansory's Avatar
    Join Date
    Nov 2000
    Location
    Cleveland, OH
    Posts
    702
    What about if null, if there is nothing there, by default the return will be null until it is set.
    L. Jones
    www.urbansory.com

  7. #7
    Banned MopFlash's Avatar
    Join Date
    Jan 2003
    Location
    Perth, W.A.
    Posts
    136
    like Urbansory said u could use
    on(release){
    if (youtextfield eq null){
    your action
    }

  8. #8
    ask me one on fish..not flash
    Join Date
    Oct 2002
    Location
    southern u.k.
    Posts
    495
    well i think you have too many = signs.

    i would have put

    if email="" then do some clever stuff

    gary
    I bought a Ouija board. The pointer spelled out 'You don't actually believe in this crap, do you

  9. #9
    The Definition of... Urbansory's Avatar
    Join Date
    Nov 2000
    Location
    Cleveland, OH
    Posts
    702
    You need 2 equals or the player will think you are trying to set something not test if it is equal to the expression or whatever it is.
    L. Jones
    www.urbansory.com

  10. #10
    Banned MopFlash's Avatar
    Join Date
    Jan 2003
    Location
    Perth, W.A.
    Posts
    136
    you can just use "eq" instead of "=="

  11. #11
    ask me one on fish..not flash
    Join Date
    Oct 2002
    Location
    southern u.k.
    Posts
    495
    lol of course you do, i just looked in one of my fla's and there they were == sitting there giggling at me

    sorry guys..

    gary_wanders off hanging head in shame
    I bought a Ouija board. The pointer spelled out 'You don't actually believe in this crap, do you

  12. #12
    The Definition of... Urbansory's Avatar
    Join Date
    Nov 2000
    Location
    Cleveland, OH
    Posts
    702
    on (release) {
    if (email == "" or email == null) {
    email_alert.gotoAndPlay (2);
    }
    }
    L. Jones
    www.urbansory.com

  13. #13
    Banned MopFlash's Avatar
    Join Date
    Jan 2003
    Location
    Perth, W.A.
    Posts
    136
    thats a simple way to win both arguments

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