4 Replies Latest reply on Nov 6, 2007 4:38 PM by clbeech

    Flash form eMail confirmation

    Stan20000
      Hello all,

      Am currently in that dark pit of frustration that we all know so well. The situation: I have built a lovely flash form. Form contents get sent to my server via PHP. Server then bundles form content into a tidy email. All works fine. The tricky bit is to have flash compare two fields before the form content is sent to the server: "email" field and "confirm email" filed. These fields should match up before sending. If they don't match up, I would like to have either an error message or have the clip jump to a frame that indicates the error.

      I've based my form entirely on Kirupa.com's workings:
      http://www.kirupa.com/developer/actionscript/flash_php_email.htm

      - All my form fields are in a movie clip named "form" on the main time line
      - Form fields are input text fields named "inputField_01...inputField_09" and have pretty standard variable names like "fname" "lname" "phone" "email" "emailConfirm"....
      - The "form" movie clip has the following action script attached to it:


      onClipEvent(data){
      // show welcome screen
      _root.nextFrame();
      }


      - The submit button has the following action script attached to it:


      on (release) {
      // send variables in form movieclip (the textfields)
      // to email PHP page which will send the mail
      form.loadVariables("email.php","POST"); }
      }


      All of this works great, thanks to Kirupa.com. Although in trying to modify the script I have had no success. A lot of no success. This is where I am at:


      on (release) {
      if (form.inputField_04.text != form.inputField_05.text) {
      _root.gotoAndStop(noMatch); }
      else {
      form.loadVariables("email.php","POST"); }
      }


      Any help would be greatly appreciated.
      Kind thanks in advance!
      :confused;
        • 1. Re: Flash form eMail confirmation
          clbeech Level 3
          well, as long as the inputFields '_04' and '_05' are supposed to match, the only thing I see here is that you did not put quotes in the gotoAndStop('noMatch') frame label call. Course I would place the button handlers on the timeline, and probably use the LoadVars class, but if it aint broke,...

          depending on the location of the button, sometimes you will also need to call down a level using _parent, but if the form.loadVariables call is making a connection then it must be in the right path structure. otherwise it would be:

          _parent.form.inputField_04
          _parent.form.inputField_05
          _parent.form.loadVariables()
          • 2. Re: Flash form eMail confirmation
            Stan20000 Level 1
            Thanks you Sir,

            That did the trick. You certainly do good in this world. I saw/read you help "Janst" with his form validation epic. That was very instructional.

            P.S. Please stay tuned. Now that I've gotten this far I will no doubt be getting under the hood of this thing. Suffice it to say, further blundering to ensue...and further need of a helping hand.

            Much gratitude,

            Stan
            • 3. Re: Flash form eMail confirmation
              Boxing Boom Level 1
              Hi,

              Very interesting, I need this ability myself.

              Boxing Boom
              • 4. Re: Flash form eMail confirmation
                clbeech Level 3
                You're very welcome, and Thanks :)

                I read a book once about being a CEO and one thing that was stressed was 'fast failures', we learn from our mistakes and from experience, and this way you gain quickly as possible, just keep trying, every time you fail, you're closer to success.