Detect Error state of field
Detect Error state of field
![blabablaba](https://secure.gravatar.com/avatar/535d6536242d4f5a74db99bbe0ffeec7/?default=https%3A%2F%2Fvanillicon.com%2F535d6536242d4f5a74db99bbe0ffeec7_200.png&rating=g&size=120)
Hi guys,
Question: How do I get a true false check on whether a field is currently displaying a fieldError? Or even to return the error message for comparison.
I have created a field which takes address input. With each key-strike, the Editor client sends an ajax lookup to the server.
The server looks up the address but usually responds with the error text "not found" until there is enough data. I update the error field using:
editor.field('lookup').error('not found')
However! This causes the error to 'reappear and reanimate' each time, which looks odd.
My proposed solution is to write something like this:
if(editor.field(e['name']). HAS NO ERROR)
editor.field(e['name']).error(e['status'])
Such that the error appears and does not update for every identical repeat error.
My problem is that I have been unsuccessful at finding out how to check if a field is in error.
References:
Any help gratefully received!
Answers
I found the answer:
field().inError()
Sorry to trouble you.
Steve