2 Replies Latest reply: Apr 24, 2010 9:59 AM by Shane P RSS

    Formmail Redirect Question

    Shane P Community Member

      Hello Everyone,

       

      I am a little stumped here. I have a AS3 fla and I have 3 simple contact fields. I am using formmail.pl to pass the data through to email. I published the swf and uploaded to my server and the data passes fine. My problem however is instead of having the default thankyou open up from the formmail.pl file is there a way with AS3 to tell flash once the data has been submitted to gotoAndStop on a specified frame and show the user my own thank you page in the same swf file?

       

      Here is the code I have for my form. Everything resides in the first frame.

       

      ----------

       

      stop();

       

      var address:String = "/cgi-bin/formmail.pl";
      var url:URLRequest;
      var variables:URLVariables = new URLVariables();
      variables.subject = "Information Requested";
      variables.recipient = "me@mydomain.com";

       

      function sendForm(event:MouseEvent):void

       

      {
         variables.name = name_txt.text;
         variables.email = email_txt.text;
         variables.comments = comments_txt.text;
         url = new URLRequest(address);
         url.method = URLRequestMethod.POST;
         url.data = variables;
         navigateToURL(url);
      }

       

      submit_btn.addEventListener(MouseEvent.CLICK, sendForm);

       

      ----------

       

      Any help would be grateful.

      Thank You,

      Sahne

        • 1. Re: Formmail Redirect Question
          kglad CommunityMVP

          you can use a complete listener and you can change the perl code to return "success" or "not".

           

          oh, you should be using an urlloader, not navigateToURL();

          • 2. Re: Formmail Redirect Question
            Shane P Community Member

            kglad,

             

            Thank you for the response and the help. Unfortunetely I have no clue how to do that, I'm very weak in action scripting. The code I used to pass the data I found on a blog and just edited the variables. Would you be able to put the code on how to do that? I do thank you for your response and trying to assist. Its appreciated.