You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
When filling in values in a form, I need to validate fields by doing some remote fetch on the server to see if it's valid.
Describe the solution you'd like
How do I set errors on the server side for a field and send it back to the client?
Describe alternatives you've considered
Tried something like this
Additional context
Often form input would require some lookups and double checking before we can accept the form.
Not sure I'm missing something, but the docs does not seem to be clear on that?
The text was updated successfully, but these errors were encountered:
if (form.data.email.includes('spam')) {
// Will also return fail, since status is >= 400
// form.valid will also be set to false.
return message(form, 'No spam please', {
status: 403
});
}
should it not be able to attach the "No spam please" message to the email errors ?
Is your feature request related to a problem? Please describe.
When filling in values in a form, I need to validate fields by doing some remote fetch on the server to see if it's valid.
Describe the solution you'd like
How do I set errors on the server side for a field and send it back to the client?
Describe alternatives you've considered
Tried something like this
Additional context
Often form input would require some lookups and double checking before we can accept the form.
Not sure I'm missing something, but the docs does not seem to be clear on that?
The text was updated successfully, but these errors were encountered: