Form Validation

Form validation itself is very easy. Developers simply need to validate the form on the server and then send the validation results in a partial server response. No front-end validation is required. This action only need Briz.js

in the frontend, you just have to write this code.

<form data-ajax
  data-swap="form"
  action="/partials/form_validation"
  method="post"
>
  <input type="text" name="name" placeholder="Your name" />
  <input type="email" name="email" placeholder="Your email" />
  <button type="submit">Submit</button>
</form>

<div data-swap="result">
  <p>Submit for some greet!</p>
</div>

The code above will send a post request and will return a partial form with an error if it is an error, and a greeting if it is successful.

Demo





Submit for some greet!


Go back