- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-13-2016 01:43 PM
I added a field to the incident form but it doesn't have spellcheck enabled. I tried with various different field types but it doesn't seem to matter which type I use. I looked up ServiceNow spell check and found references in a few places to ServiceNow having enabled spell check on "...applicable fields..." but I'd like to be able to turn it on myself. I found a few possibilities but it looks like I'd need to mess with the field HTML directly which is something you aren't supposed to do. Does anyone else either know or have some idea how to enable spellcheck on a field?
My thoughts were to try using either g_form.getControl() or g_form.getElement() and then setting the spellcheck property of the field to true. It seems to be supported pretty well in browsers but I'm not sure how well that would work in SNow. http://caniuse.com/#search=spellcheck
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-20-2016 10:03 AM
Seems like we were on the right track. Adding spell checking on a per field basis isn't supported. They did open an enhancement request for it though so hopefully we'll see it sooner than later. In the interim I'll probably just mess with the DOM.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-14-2016 05:31 AM
Which UI are you using? UI15 onwards will have spellcheck="true" added to those 'applicable' fields but before that it would have relied on the ServiceNow internal spellcheck so those tags wouldn't have been present.
OOTB the applicable fields as far as I can tell seem to only include elements which get rendered as a textarea (excluding script blocks) and also excluding HTML editor which has it's own spellcheck mechanism. Whether they get the spellcheck="true" attribute rendered or not seems to be still be controlled by the old spell_check value on each dictionary entry. E.g. I set spell_check= false on the work_around field in the problem table and it prevented the spellcheck attribute from being added
Don't get too excited though, I tried enabling this value for a short string (single line text input) dictionary entry and it ignored it. 😞 This could be a good candidate for an enhancement request for ServiceNow to consider - to make the rendering of a single line text box include the spellcheck="true" attribute if the dictionary entry is marked as spell_check=true.
Warning: unsupported territory...
You could of course use a client script with g_form.getControl('short_description') and whack in a spellcheck="true" attribute, but the risk you carry is that this is unsupported as it is direct DOM manipulation. Also The methods getControl(), getElement(), and getFormElement() are deprecated for mobile devices. as seen here http://wiki.servicenow.com/index.php?title=GlideForm_(g_form)#getFormElement&gsc.tab=0. If you were to go down a direct DOM method such as document.getElementById, you'd have to accept that it may break if the DOM or element naming strategy is changed by ServiceNow in the future.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-14-2016 08:13 AM
That is about what I figured. I'll open a HI ticket and we'll see where it goes. If they provide any options I'll post back here if possible. Thanks for the research and advice!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-14-2016 12:28 PM
Cool, no worries.
If they come back and say it's a limitation at present, could you push for an enhancement request to be raised similar to my previous comment. At least it would get dealt with eventually that way.
Good luck!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-20-2016 10:03 AM
Seems like we were on the right track. Adding spell checking on a per field basis isn't supported. They did open an enhancement request for it though so hopefully we'll see it sooner than later. In the interim I'll probably just mess with the DOM.