2 Replies Latest reply on Apr 10, 2009 11:06 AM by jakes51

    Help with field verification mail form

      Could someone help me please? I have a flash and php based mail form that needs to have the fields verified. So when a user does not insert info in the text fields, an error clip will play. The form works fine without the verification of fields, but I want to prevent from receiving blank emails.

       

      The form is created in 2 parts or tutorials since I'm trying to add field verification or error message. Here are the links of the tutorials.

      http://www.gotoandlearn.com/play?id=50 and the next link is for the field verification.

      http://www.macromediahelp.com/flash/php_flash_contact_form//

       

      I'm using CS3 with AS1 and 2. Here is my original AS without the verification.

      stop();
      var senderLoad:LoadVars = new LoadVars();
      var receiveLoad:LoadVars = new LoadVars();

      submit2.onRelease = function() {
      senderLoad.name2 = name2.text;
      senderLoad.email2 = email2.text;
      senderLoad.address2 = address2.text;
      senderLoad.phone2 = phone2.text;
      senderLoad.sendAndLoad("http://www.agdeal.com/flash/sendmike2.php",receiveLoad);
      }

      receiveLoad.onLoad = function() {
      if(this.sentOK) {
        _root.gotoAndStop("success");
      }
              else {
        _root.gotoAndStop("failed");
      }
      };

       

      Any help is MUCH Appreciated Thanks.

        • 1. Re: Help with field verification mail form
          Dan.Smith

          I have a sample here:

          http://www.smithmediafusion.com/blog/?p=235

           

          Let me know if this works for your needs.

          • 2. Re: Help with field verification mail form
            Level 1

            I'm not quite sure that will work. I seem to be using a whole different kind of actionscript. As you can see in my first post, i'm using 2 frames for success and failed to let the user know what's going on. I have done some modifications since then, adding an "error" mc. It seems to work, but now it won't go to the success frame if all is correct.

             

            I don't really care if I have to use a movie clip or just make it go to another frame. As long as the user knows what's happening. I'm not very good with actionscripting, and as I mentioned in my first post... I used 2 different tutorials for the form. It's like having to match another tutorial that works with what I have already. 1st tutorial was for the form itself. But then I found that I need to have fields validated so that's what the second link is. Below is my modified AS. I would upload my form document but it appears I can't upload a zip file let alone a .fla. Otherwise my email is jakes_51@hotmail.com if anyone needs to see my source files if that could help.

             

            stop();
            submit2.onRelease = function() {
                if (name2.text == "" || email2.text == "" || address2.text == "" || phone2.text == "")
                {
                    error_clip.gotoAndPlay(2);
                }
                else
                {
                    error_clip.gotoAndStop(1);
            }
             
            var senderLoad:LoadVars = new LoadVars();
            var receiveLoad:LoadVars = new LoadVars();
               
                    senderLoad.name2 = name2.text;
                    senderLoad.email2 = email2.text;
                    senderLoad.address2 = address2.text;
                    senderLoad.phone2 = phone2.text;
                    senderLoad.sendAndLoad("http://www.agdeal.com/flash/sendm2.php",receiveLoad);
            }

            receiveLoad.onLoad = function() {
            if(this.sentOK) {
              _root.gotoAndStop("success");
            }
                    else {
              _root.gotoAndStop("failed");
            }
            }