github repository for svelte forms lib

Custom validation

This example shows how you can use your own validation functions. Validation is fired when field changes and upon submission. The validate callback is called and given the latest form values as argument.

In the callback you can construct and return an error object. If the errors object contain values the form will not submit and errors can be rendered. If an empty object is returned the form will be valid and submit.

This library does not include any styling for the forms. Feel free to copy and customize this css for your own use.