Basic HTML Forms
Basic HTML Forms (i.e. good old <form>
s with no JavaScript or AJAX) are awesome. At FormJam, we embrace them fully!
There are a few quirks to be aware of:
method
FormJam Forms must use method="POST"
<form method="POST" action="https://api.formjam.io/form/...">
Redirect Behaviour
HTML Forms cause the browser to navigate, which means we have to tell it where to go once the form is submitted.
If your form submission is successful:
- if you've specified a
redirectUrl
in your Form's configuration, FormJam will redirect to it. - if you haven't defined a
redirectUrl
, the API will return a success page generated by FormJam.
If there are any errors in submitting your form:
- if you have specified an
errorRedirectUrl
in your Form's configuration, FormJam will redirect to it. The redirect will have appended to the querystring?error=true&&errors=...
whereerrors
is the validation errors object serialized using qs.stringify(). - if you have not specified an
errorRedirectUrl
but a have specified aredirectUrl
, this URL will be used instead, also with the error querystring. - if neither have been specified, the API will return a failure page generated by FormJam.