-1

I've created a simple amp-form, using php to send results by email. The form works, including the submit-error message, which displays properly. However, on successful submit, the submit-success message never displays. I'm completely puzzled.

Here's a snippet of my code, modeled exactly on the AMP By Example examples:

<div><button type="submit" class="form-button-class">send</button></div>
<div submit-success><template type="amp-mustache">Success! Thanks for your message.</template></div>
<div submit-error><template type="amp-mustache">There was a problem sending your message.</template></div>
</form>

Additional note: the submit button grays out on submit, but refuses to hide, when I use the proper CSS (also from AMP documentation) -- maybe this is related? For now, I removed the css for cleaner testing.

Any ideas as to what might be causing this? Could it be on the php handling end? Thanks!

benjamin
  • 1
  • 3
  • we have forms that do what you ask. so something else is wrong. as has been said on stackoverflow a BILLION times - if you want help, show a working example that faults at some place. – Jay Gray Apr 07 '18 at 10:28
  • Thanks Jay. There may be a "BILLION" similar reports here, but I've read through all the ones I could find, and didn't see any with the behavior I described (error DOES return, but success does not). Would welcome help, and happy to provide anything I can -- but can you help me figure out what will help you help me? Since the form does get processed with success by php handler, and there are no error codes there or in AMP renderers, what I can I provide? Thanks in advance. – benjamin Apr 07 '18 at 14:28
  • Just remember that if to have access to debug information you should append the text "#development=1" to the URL. If you do this, you will see the error message that is preventing the form to work (in this case it looks like it would have displayed a JSON related issue) – Tk421 Jun 03 '19 at 23:17

1 Answers1

-1

For anyone interested or facing the same behavior: in my case, this was a json scripting issue. No idea why error processing works just fine, but json caused success actions not to happen after successful submit. Fixing this allowed submit-success message to display properly.

benjamin
  • 1
  • 3