In my application user is allowed to add objects in text (represented as HTML tags) by selecting a part of it. Something like in the rangy.js demo but the object is being added immediately after users selects the text:
However, there are some restrictions for selections, for example:
- selected text must be shorter than X characters
- selected text must not contain another, already added object
- selection must not go through multiple paragraphs
How to notify user that his selection was invalid? I can think of some options, neither of which appeals to me:
- do nothing (i.e. deslect the text and do not add the object)
- show an alert / a dialog with error message (which would be too distracting, I think)
- display an error message above the whole text or in top/bottom right/left corner of the screen
- a tooltip "attached" to mouse pointer saying what went wrong
Any ideas?
The whole context looks like this:
download bmml source – Wireframes created with Balsamiq Mockups
Users can add objects in the Content.