Handling validation/input errors on Widget update
I’m looking to the community to point me to examples of best practices or conventions around handling invalid user input on widget update.
As an example, suppose in my widget form, I have a field labelled “Number of posts”, and the user either enters some text, or a number that is out of range. In the update method of the widget, I can easily check and then just use the default value if the input is invalid.
But by itself, this isn’t good UX practice – we need to let the user know that his input was invalid, and possibly why. At the very least I’d like to show an error message – somewhere.
Is there a convention or protocol for doing this? How does update() communicate with form() to let form() know it needs to post an error message? Or does update() post the error message. And where?
Thanks in advance!
PS: yes, of course we can prevent the user entering the wrong info with JS validation or pull-down menus. But that’s not what this question is about. My example is deliberately simple.
- The topic ‘Handling validation/input errors on Widget update’ is closed to new replies.