A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Check 2 email address

  1. #1
    Life is like a box.......
    Join Date
    Jul 2001
    Location
    London
    Posts
    67

    Check 2 email address

    Hello.

    I have a recomend bit on my site.
    I have the script to check one e-mail but I cannot work out how you can check two.

    The script I'm using at the moment is:

    on (release, keyPress "<Enter>") {
    if ((vemail.indexOf("@") != -1) && (vemail.indexOf(".") != -1) && (length(vemail)>5)) {
    action = "Send";
    loadVariablesNum("membership.php", 0, "POST");
    nextFrame();
    } else {
    vemail = "PLEASE ENTER EMAIL";
    action = "";
    stop();
    }
    }





    How can I alter this so it would check two ??

    The script above checks the - TEXT BOX: "vemail" but i need it to do the same thing with TEXT BOX: "femail" too.


    If you want have a look at what I done so far , check http://www.feneo.com (Its at bottom Left)

    I'm so stuck. Pleeeeeeeeeease help

    Thanks in advance


    Dihan.com

  2. #2
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    if ((vemail.indexOf("@") != -1) && (vemail.indexOf(".") != -1) && (length(vemail)>5)&&(femail.indexOf("@") != -1) && (femail.indexOf(".") != -1) && (length(femail)>5))

    have you tried that simple solution?

    gparis

  3. #3
    Life is like a box.......
    Join Date
    Jul 2001
    Location
    London
    Posts
    67
    Nearly there:

    What happens at the moment is that, if one is wrong the other says, both boxes says = PLEASE ENTER EMAIL

    What whould be great if they are both independent for them self and check speratly.


    This what I'm using now :

    on (release, keyPress "<Enter>") {
    if ((vemail.indexOf("@") != -1) && (vemail.indexOf(".") != -1) && (length(vemail)>5) && (femail.indexOf("@") != -1) && (femail.indexOf(".") != -1) && (length(femail)>5)) {
    action = "Send";
    loadVariablesNum("recomend.php", 0, "POST");
    gotoAndPlay("andagain");
    name.text = "Thank You - Recomendation sent";
    } else {
    vemail = "PLEASE ENTER EMAIL";
    femail = "PLEASE ENTER EMAIL";
    action = "";
    stop();
    }
    }


    Thanks peeps

    Dihan.com
    Flash Kit Rules | Dihan.com | Feneo.com

  4. #4
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    and if one is ok (some var is true) and the other is not ok (some other var is false) what happens? do you send? or do you send an alert like "please enter valid email" in the appropriate box?
    If you do not mind the "appropriate box" just replace && (and) by || (or) between vemail and femail. If not use variables (see above)
    and maybe you should put the check on(press) and the result action (loadVariables) etc.. on(release)
    gparis

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