4 Replies Latest reply on Mar 5, 2008 2:24 AM by SteveH59

    Form sends but does not appear to send

    SteveH59 Level 1
      Hello

      I have a small problem with the online form I have. When the site visitor sends the form (by clicking submit) the form is received by the Webmaster, but it does not appear to have been sent to the site visitor. That is, all the details, name, email, etc remain in place in the online form after the submit button has been clicked.

      I am posting this here because I think the form processing aspect of my query works fine, so I assumed this was a Flash problem. I am using Flash MX 2004.

      This the relevant part of my AS:

      var serverLang:String = "asp";
      var email_lv:LoadVars = new LoadVars();
      email_lv.onLoad = function(success) {

      if (success) {

      if (email_lv.server_mes == "ok") {
      status_txt.text = "Thank you, " + name_txt.text;
      }
      } else {

      status_txt.text = "Sorry, your message was not sent";
      }
      };

      submit_btn.onRelease = function() {

      email_lv.sendAndLoad("fla.asp", email_lv, "POST");
      }
      };

      Thanks.

      Steve
        • 1. Re: Form sends but does not appear to send
          Greg Dove Level 4
          At the moment your code is only set up to display a message and not to blank out any input fields etc.
          I presume some onChanged handlers for the input fields change the values in email_lv or perhaps some enterFrame loop etc.
          You would normally do things either in the submit_btn handler or email_lv.onLoad handler to hide or remove the input fields.
          So you would need code to do that part.

          If you mean something else, for example that the
          if (success) { (etc)
          part of your code is not executing after the form has been successfully processed on the server (And the message "Sorry your message was not sent" is being shown instead)

          In that case, perhaps your server script is not returning the expected value. All you need do in that case is have the asp script return "server_mes=ok" in the body of the response. That will give the LoadVars a return value to work with instead of nothing and then the (success) branch of your code should execute .
          • 2. Re: Form sends but does not appear to send
            SteveH59 Level 1
            Hello GWD

            Many thanks for your message.

            When the submit button is clicked there is a millisecond of a pause before Flash displays 'Thank you GWD'. Since this is conditional on Flash receiving the Text if (email_lv.server_mes == "ok") { I presume that the processing has gone ahead successfully. Besides, the information is stored successfully ina database and the Webmaster receives a copy of the sent form.

            Therefore, I presume I need to 'do things either in the submit_btn handler or email_lv.onLoad handler to hide or remove the input fields'.

            If possible, once the form is sent and the 'Thank you GWD' message displayed, the fields ought to be blank, don't you think?

            Cheers

            Steve
            • 3. Re: Form sends but does not appear to send
              Greg Dove Level 4
              quote:

              If possible, once the form is sent and the 'Thank you GWD' message displayed, the fields ought to be blank, don't you think?


              Yes, that would be usual, and probably expected. But it's entirely up to you how you choose to implement it. You could, for example:
              a) in the onRelease handler:
              disable the submit button to prevent click-happy users running the code many times, and display a status message saying 'sending'.
              b) in the onLoad handler (success branch) :
              set the Thank you USER status message.
              disable (change type property) or remove or set visibility to false for input textfields etc.
              • 4. Re: Form sends but does not appear to send
                SteveH59 Level 1
                Hello GWD

                Many thanks again for your input.

                I think I will display a message alongside the 'thank you', to say 'your message has been sent. Please check your inbox', or something along those lines. This might deter some users from continually pressing the submit button, believing, falsely, that their message has not been sent.

                To take up your suggestion, what I could then do is
                quote:

                disable (change type property) or remove or set visibility to false for input textfields etc.


                How would I set visibility to false - it would need to be conditional after having sent the form, wouldn't it? And when you say visibility, do you mean the user's text is not visible, or the fields themselves? I would prefer the fields to be visible (but not the user's input), otherwise it would appear to the user as if the entire form had disappeared from the site!!

                Thanks again.

                Steve