Welcome, Guest
  • Author Topic: @ as must by contactmail  (Read 1834 times)

    depp

    • Jr. Programmer
    • **
    • Posts: 68
      • View Profile
      • Email
    @ as must by contactmail
    « on: 04/13/04, 06:36 »
    hi,

    i´ve a contactmail, but i want that everybody had to write a "@" in the email filed!
    Without "@" nowbody should send the contactformular, but i dont know how to write this!

    Can you help me?

    Jorge Solis

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 14616
      • View Profile
    Re:@ as must by contactmail
    « Reply #1 on: 04/13/04, 06:48 »
    Try

    if(email.indexOf("@")==-1) trace("Invalid email")

    When the indexOf method doesn't find some character, it return -1

    Jorge

    depp

    • Jr. Programmer
    • **
    • Posts: 68
      • View Profile
      • Email
    Re:@ as must by contactmail
    « Reply #2 on: 04/13/04, 07:48 »
    ohh, thanks!
    But i´ve a problem to set it in my script!

    In the script it only check if there is anything in the filed!
    Can you help me?




    on (release) {
                      if (Email eq "") {
          _root.Status = "Pleas enter Adress!";
       }
    « Last Edit: 04/13/04, 08:04 by depp »

    prasad gvss

    • Seasoned Programmer
    • ***
    • Posts: 124
    • India
      • View Profile
      • Telugu Entertainment
      • Email
    Re:@ as must by contactmail
    « Reply #3 on: 04/13/04, 08:38 »
    hi

    Give the email box an instance name email and a variable name Email (or whatever you want!)

    for the submitt button.

    on (release) {
                     if ((Email.length<6)||(Email.indexOf("@")==-1)) {
         _root.Status = "Please enter correct Adress!";
      }
    }

    hope that helps.

    Cheers,
    pessi..
    Prasad Gurla,
    Ph.D student in Materials Science,
    Aachen,
    Germany.

    depp

    • Jr. Programmer
    • **
    • Posts: 68
      • View Profile
      • Email
    Re:@ as must by contactmail
    « Reply #4 on: 04/13/04, 13:00 »
    ohhh, thats nice, thanks!!!!!!!!1