According to the docs on form validation, I can add errors manually:
add errors(errors) | Adds errors to form, given an array errors
(I want to use this feature because I submit my form via AJAX, do server-side validation, then want to display the results.)
I tried the following code:
$('#my-form').form("add errors", [ 'error' ]);
$('#my-form').form("validate form");
I get this contradictory output from the console when calling the above methods, and the form validates as successful when it obviously shouldn't.

Unless I'm doing something wrong?
As a side note, as the documentation is far from clear, in the array of errors, (how) can I link an error to a field name?
I need to rewrite some of this #752. I'll keep this in mind while working on it
Hi there! Any progress on this issue?
I've dug up this api from source to manually show inline errors:
$('.form').form('add').prompt('fieldname' (from name attribute),'error text')
There is also a remove method:
$('.form').form('remove').prompt('fieldname')
@avalanche1 it seems that using your line of code only colors the field with red but does not show the 'error text' in errors list.
However, using
$(this.refs.form).form('add errors', {
email: 'error text',
});
does show the error in the list, but does not color the field.
EDIT: I found that if using "inline" option, the error does show up...
it's strange though it doesn't show up in non-inline mode
+1
+1 This is very urgent. There is no proper documentation on this. I need to integrate these forms with Angular.
@eyalw , yep, I only use inline error prompts.
+1 , this is important feature.
Agree with @timothycoutlakis , this is very urgent.
@avalanche1
In this way looks better
$(this).form('add prompt', 'fieldname', 'error text');
$(this).form('remove prompt', 'fieldname');
None of the above works for me. But this does:
$('.form').form('add prompt', 'email');
$('.form .error.message').html('Please enter a valid email address').show();
$('#form').form('add errors', {password: 'Invalid Credentials', email: 'Invalid email'})
$('#form').form('add prompt', 'email')
$('#form').form('add prompt', 'password')
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 30 days if no further activity occurs. Thank you for your contributions.
a) Unstalification
b) This disfunction is so quirky and commonplace that it should be a BUG, not an enhancement.
Most helpful comment
@avalanche1
In this way looks better