This method is deprecated.
Deprecated. This method will be deprecated on March 30, 2026. Replace with getForm().
Migration Instructions
To stay compatible with future changes, migrate to
getForm(). The validation is now performed under the hood by the getForm() method.
To migrate to the new method:
Add a backend file to your site.
Write a code so that it replaces the validateInput() method from the frontend with the getForm() method from the backend. Export your backend function so that it can be used in the frontend.
Import your backend function into the frontend file. Test your changes to make sure your code behaves as expected.
validateInput() returns {valid: true}
if the value in the specified field is valid and throws an error if it's not valid.
You may want to call validateInput() in an input element's
onCustomValidation()
to validate an input while the form is being filled out.
Note: The frontend Events APIs aren't functional when previewing a site. View a published version of a site to see their complete functionality.
Name of the input field to validate.
Field names and values for a registration form.
This method doesn't return any custom errors, but may return standard errors. Learn more about standard Wix errors.