Contact Form tutorial not submitting

11 views
Skip to first unread message

Cli F

unread,
Sep 10, 2016, 7:50:49 PM9/10/16
to apostrophenow
I've followed your Contact Form tutorial, and checked and double checked the code. I can add a form to the page, but there are two issues

1. The form responses do not get validated or added, the page simply reloads..

2. The thank you text is always visible, e.g.:

Thank you for getting in touch! We'll respond soon.




Cli F

unread,
Sep 11, 2016, 2:49:22 AM9/11/16
to apostrophenow
OK so the documentation for the always.js and always.less files need to include a /public/ folder...

eg

// in lib/modules/contact-form-widgets/css/always.less
should be


// in lib/modules/contact-form-widgets/pubic/css/always.less
etc...

Cli F

unread,
Sep 11, 2016, 3:07:15 AM9/11/16
to apostrophenow
And one more thing.. if the form is supplied with invalid data the Thankyou message is still deployed, so you can't re-enter your information. An else statement fixes that. So change this:

if (err) {
            alert('Something was not right. Please review your submission.');
          }
          // Replace the form with its formerly hidden thank you message
          $form.replaceWith($form.find('[data-thank-you]'));
        });
to

if (err) {
            alert('Something was not right. Please review your submission.');
          } else {
          // Replace the form with its formerly hidden thank you message
          $form.replaceWith($form.find('[data-thank-you]'));
}
        });

Tom Boutell

unread,
Sep 11, 2016, 9:32:25 AM9/11/16
to apostr...@googlegroups.com
Thank you for catching these oversights! I will get them incorporated
into the tutorial.
> --
> You received this message because you are subscribed to the Google Groups
> "apostrophenow" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to apostropheno...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--


THOMAS BOUTELL, SUPPORT LEAD
P'UNK AVENUE | (215) 755-1330 | punkave.com
Reply all
Reply to author
Forward
0 new messages