Spell Check for specific controls in SharePoint

By default we already have a Spell Check option in SharePoint and it will check entire page. But recently one of my colleague got a requirement that their customer wants spell check for specific controls means there are two multiline text boxes and adjacent to each text box there will be a button to do spell check. Customer wants to enable spell check to specific control explicitly.



Hope you people may know that there are two components involved to do spell check OOB. One is webservice (SpellCheck.asmx) and another one is applicaiton page (SpellChecker.aspx). In OOB we already have one javascript file called SpellCheckEntirePage.js and it has all the code related to Spell check. It will do the following steps.
  1. Get all elements in the page and stores in a array.
  2. Loop through each element to identify input field elements and stores in another array.
  3. Stores each elements value in another array called ChunksToSpell.
  4. Also it stores each control reference in another array called spellableFields which will be used to replace selected value from spelling suggestions.
  5. Finally these values will be passed to application page in the form of dialog arguments.
  6. The application page has a code to pass these values to web service and showing the suggestions on the page.
Now what I did is I just took the copy of SpellCheckEntirePage.js file and modified the script. Here I have modified function SpellCheckEntirePage to SpellCheckControl and it accepts following arguments.
  1. Webservice url
  2. Dialog url (application page)
  3. Array of control ids
I have removed the code related to read all elements in the page instead I am storing specific element references in elements array.






Comments

  1. Hey the link the file is broken or the file is not available in rapidshare! can i get the file mailed please?

    ReplyDelete
  2. Hello I've the similar requirement to enable spell checking for specific control. But couldn't get it working till now. Can you please post the edited version of SpellCheckEntirePage.js ? I'm having difficulty in editing this file.

    ReplyDelete
  3. Hello, please could you send me a link to the edited SpellCheckEntirePage.js file? I've been trying to do this for a while but my javascript skills aren't even remotely up to scratch! Thanks

    ReplyDelete

Post a Comment

Popular posts from this blog

Switch from Classic to Claims Authentication in SharePoint 2010

How to query list data using web service