This extensions makes it dead easy to handle form submissions of any HTML5 form with Webpop.
Place the forms.js file in the extensions folder of your project. Then just write the html for the form as you would for any normal HTML form. Replace the <form>
tag with <pop:forms:form mailto="email@example.com">
and you're done.
Inside the <pop:forms:form>
tag you can use <pop:success>
and <pop:error>
to display a message on successful form submission or on a validation error.
The HTML5 validations for the attributes required
, min
, max
, minlength
, maxlength
and pattern
will automatically be handled server-side (for browsers that doesn't handle them client-side). When a form submission fails due to a validation error, the form fields will keep the submitted values.