Sunday, April 5, 2009

Want to know how to skip SharePoint spell check for an input control?

This may seems strange to you at first, but today I got an email from our support engineer that reads:

Hi,
When doing spell checking on a list form with the cascading field type, we are getting this error:
















Please assist

Well... I know what you were thinking... this guy has some serious spelling mistakes, right?

Thing is, this text wasn’t actually a user input text – it was a hidden text box. You see, for debugging purposes we sometimes use textboxes with style=”display:none” instead of input type:”hidden” fields.

While SharePoint Spell Check skips hidden inputs, it does not skip hidden text boxes, so our textbox gets the same treatment as all other user inputs on the page.
In our Cascading Lookup Plus Field Type we use hidden inputs like that to store information between post backs. We believe it is important that users not get prompted for spelling in these controls, let alone try and fix them!

So, after searching MS documentation with no luck (big surprise eh?), I came across one lone blog post that speaks of the SharePoint spell check feature, and specifically how to register a control to be excluded from spell checking.

Turned out to be a rather simple task, all you need to do is add excludeFromSpellCheck=”true” to any input control you don’t want checked and you are done!

P.S. funny thing is that the SharePoint people picker field control also gets spell checked, prompting users on their domain name or user names...













Maybe there will be a fix for that someday as well...

For now – at least we can update our field controls and other web parts accordingly.

Good luck and happy SharePointing!

Shai.

2 comments:

Unknown said...

You just made my day!! Its woking. Thanks alot.

Unknown said...

You just made my day!! Its working for me.. Thanks alot!!