Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Sep 2012
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Action scrip working but need help with PHP mail please

    Hi all. I have been working on a action script for a long time and finally got it working. I am totally lost of how to write my PHP email codes for when the person press submit all the information they fill in is sent to me via email could someone help me please. I found tons of example off the internet to write a basic one but nothing close to what I have. Could someone please help me. Below is my action script code I use.

    [import fl.controls.*;
    import fl.controls.RadioButtonGroup;

    //This sets a group name for the radio button instances.
    var myradioGroup:RadioButtonGroup = new RadioButtonGroup("RadioButtonGroup");

    //This assigns the radio button instances to the radio group.
    cRadio1.group = myradioGroup;
    cRadio2.group = myradioGroup;

    submit_btn.addEventListener(MouseEvent.CLICK, submitFunc);
    var radBtns = [cRadio1,cRadio2];
    var errorsNum = 0;
    function submitFunc(e:MouseEvent)
    {
    var finalData = "";
    var errorFlag = "Followings errors were found.\n";
    if (name_txt.text == "")
    {
    errorsNum++;
    errorFlag += errorsNum+". Enter ur name.\n";
    }
    if (email_txt.text == "")
    {
    errorsNum++;
    errorFlag += errorsNum+". Enter ur email.\n";
    }
    if (mobile.text == "")
    {
    errorsNum++;
    errorFlag += errorsNum+". Enter ur phone number.\n";
    }
    if (!myradioGroup.selection)
    {
    errorsNum++;
    errorFlag += errorsNum+". Select ur gender.\n";
    }

    if (age.selectedIndex < 0)
    {
    errorsNum++;
    errorFlag += errorsNum+". Select any of the course.\n";
    }
    if (!orangecb.selected)
    {
    errorsNum++;
    errorFlag += errorsNum+". Please check one";
    }
    if (!orangelcb.selected)
    {
    errorsNum++;
    errorFlag += errorsNum+". Please check one";
    }

    if (message_txt.text == "")
    {
    errorsNum++;
    errorFlag += errorsNum+". Enter ur message.\n";
    }

    if (errorsNum > 0)
    {
    mytxt.text = errorFlag;
    errorFlag = "";
    errorsNum = 0;
    return false;
    }

    else
    {
    finalData += "Thank you "+name_txt.text+" for contacting me! I will call you at "+mobile.text+", "+"else I can mail you also at "+email_txt.text+" in "+applecb.selected+"response "+orangecb.selected+" of your message "+message_txt.text+"\n\n Your other information is, you're a "+myradioGroup.selection.value+" and is between "+age.value+"\nThanks";
    mytxt.text = finalData;
    }
    }

    ]

  • #2
    New Coder djpaul1963's Avatar
    Join Date
    Apr 2012
    Location
    Athens GR
    Posts
    74
    Thanks
    0
    Thanked 8 Times in 8 Posts
    You miss a lot and I don't think your script will ever compile succesfully because you left outside valuable piece of code.
    For example, you add a listener to a button where your submit will begin with this line:

    submit_btn.addEventListener(MouseEvent.CLICK, submitFunc);

    BUT the function itself is nowhere inside your code (or at least the part you pasted here)

    I am afraid you are wasting your time unfortunately..

  • #3
    New to the CF scene
    Join Date
    Sep 2012
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Oh no, please don't say that. I been working on this with lack of sleep for while. I test it in Flash of my browser once open and it seems to work. Above is all of the code that I used. May I ask what is wrong with the submit_btn.addEventListener(MouseEvent.CLICK, submitFunc); I thought that was my function for once the button is click on the information is sent to me? May I ask what function should it be then or better yet what is missing?

  • #4
    New Coder djpaul1963's Avatar
    Join Date
    Apr 2012
    Location
    Athens GR
    Posts
    74
    Thanks
    0
    Thanked 8 Times in 8 Posts
    I didn't want to disappoint you, I am sorry for that.
    Your code in fact includes the body of the function, my bad.
    What you need right now is the .php file as you say, but unforunately I can't help on that because I use ASP.NET as application server
    Last edited by djpaul1963; 09-28-2012 at 12:15 PM.

  • #5
    New to the CF scene
    Join Date
    Sep 2012
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi DjPaul, thank you. I was like oh man back to the drawing board. It is okay. I do appreciate you trying to help.


  •  

    Posting Permissions

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