Welcome, Guest
  • Author Topic: "erase" bloks once I hit "submit"  (Read 1670 times)

    Algreco

    • Seasoned Programmer
    • ***
    • Posts: 123
    • If it 'aint workin blame Flash!
      • View Profile
      • Line Dezine
      • Email
    "erase" bloks once I hit "submit"
    « on: 07/02/04, 07:54 »
    I must be overlooking something here. maybe someone can let me know what... I'd really appriciate it.  :D
    I'm trying to make a very simple E mail form using textinput boxes and sending variables to php.
    Thing is that my erase button stops functioning once I hit the Submit button. Why is that??
    here are the scripts for Submit and Erase:

    Submit script:
    on (release) {
    name = _parent.mailer.name.text;
    company = _parent.mailer.company.text;
    email = _parent.mailer.email.text;
    telephone = _parent.mailer.telephone.text;
    comments = _parent.mailer.comments.text;
    // Check variable data
    if (name eq "") {
    _parent.mailer.gb_status.text = "Required: Name";
    } else if (email eq "") {
    _parent.mailer.gb_status.text = "Required: e-mail Address";
    } else if (telephone eq "") {
    _parent.mailer.gb_status.text = "Required: Telephone number";
    } else if (comments eq "") {
    _parent.mailer.gb_status.text = "Required: Message";
    } else {
    _parent.mailer.gb_status.text = "Thank you for your email...";
    _parent.mailer.name.text = "";
    _parent.mailer.company.text = "";
    _parent.mailer.email.text = "";
    _parent.mailer.telephone.text = "";
    _parent.mailer.comments.text = "";
    }
    loadVariablesNum("MailPHP.php", "0", "POST");
    }

    Erase goes like this:
    on(release){
    _parent.mailer.name.text = "";
    _parent.mailer.company.text = "";
    _parent.mailer.email.text = "";
    _parent.mailer.telephone.text = "";
    _parent.mailer.comments.text = "";
    _parent.mailer.gb_status.text = "";
    }

    You can have a look at http://www.linedezine.com the e mail form is under "contact".

    Mattias Robo

    • Moderator
    • Systems Administrator
    • *****
    • Posts: 555
      • View Profile
      • nook
    Re:"erase" bloks once I hit "submit"
    « Reply #1 on: 07/02/04, 08:14 »

    You shouldn't use the same name for variables and the textboxes. I.e "name" and "name".

    I also noticed that you load the PHP-script even if something is "Required: ".
         "I've figured it out. It's not the fords... it's what's IN them!.."

    Mohsin Sumar

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 1646
    • Mohsin Sumar, Extreme Web Technologies
      • MSN Messenger - mohsinsumar@hotmail.com
      • Yahoo Instant Messenger - mohsinsumar
      • View Profile
      • Extreme Web Technologies
      • Email
    Re:"erase" bloks once I hit "submit"
    « Reply #2 on: 07/02/04, 08:45 »
    According to my knowledge, you cannot have variable names named 'name' in Flash. Name is already used by Flash referring to attributes of objects or something similar.
    - Best Regards, Mohsin Sumar
    - Mohsin Sumar dot com is hosted by Extreme Web Technologies

    Algreco

    • Seasoned Programmer
    • ***
    • Posts: 123
    • If it 'aint workin blame Flash!
      • View Profile
      • Line Dezine
      • Email
    Re:"erase" bloks once I hit "submit"
    « Reply #3 on: 07/02/04, 08:54 »
    ok.
    Changed the "name" to "yourname" and rearranged the loading php to:
    } else {
    _parent.mailer.gb_status.text = "Thank you for your email...";
    _parent.mailer.yourname.text = "";
    _parent.mailer.company.text = "";
    _parent.mailer.email.text = "";
    _parent.mailer.telephone.text = "";
    _parent.mailer.comments.text = "";
    loadVariablesNum("MailPHP.php", "0", "POST");
    }
    }
    Now I have more problems! It loads the variables as soon as the "yourname" and any other field are ok. It does indeed erase the "yourname" field but not the other ones.
    It's a mess!
    Pls take a look at the fla. It's very miniscule and I think will save time.
    http://www.linedezine.com/email.fla
    have mercy on the less computer gifted  ::)

    Mattias Robo

    • Moderator
    • Systems Administrator
    • *****
    • Posts: 555
      • View Profile
      • nook
    Re:"erase" bloks once I hit "submit"
    « Reply #4 on: 07/02/04, 09:07 »
    Al. You're still using the same name for variables and textboxes. Don't do that.
    "yourname" works right now cause its name is not the same as the variable. Get it?

    Call the textboxes like
    "nameTxt"
    "companyTxt"
    or something

    and as Mohsin said, don't use "name" as a name. !?

    maybe

    "theName"
    "theCompany"
    etc..

    then change in your fla accordingly.

    « Last Edit: 07/02/04, 13:35 by Mattias Robo »
         "I've figured it out. It's not the fords... it's what's IN them!.."

    Algreco

    • Seasoned Programmer
    • ***
    • Posts: 123
    • If it 'aint workin blame Flash!
      • View Profile
      • Line Dezine
      • Email
    Re:"erase" bloks once I hit "submit"
    « Reply #5 on: 07/02/04, 10:36 »
     :D
    It works like a charm
    Thank you my friends!
    « Last Edit: 07/02/04, 10:37 by Al »

    Mohsin Sumar

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 1646
    • Mohsin Sumar, Extreme Web Technologies
      • MSN Messenger - mohsinsumar@hotmail.com
      • Yahoo Instant Messenger - mohsinsumar
      • View Profile
      • Extreme Web Technologies
      • Email
    Re:"erase" bloks once I hit "submit"
    « Reply #6 on: 07/02/04, 13:13 »
    Glad to help out ;)
    - Best Regards, Mohsin Sumar
    - Mohsin Sumar dot com is hosted by Extreme Web Technologies