1
votes

I would like to add Sharepoint spell checker Javascript in Content Editor webpart in SP2013.

link to do it in custom page:

But my requirement is to use this in a CEW on a anchor tag. I tired the below code but its not working. What is the correct way of doing it?

<script type="text/javascript" language="javascript" src="/_layouts/1033/form.js"></script><script type="text/javascript" language="javascript" src="/_layouts/1033/core.js"></script><script type="text/javascript" language="javascript" src="/_layouts/1033/bform.js"></script><script type="text/javascript" language="javascript" src="/_layouts/1033/SpellCheckEntirePage.js"></script><script language="”javascript”" type="”text/javascript”">
function doSpellCheck() {
SpellCheckEntirePage('/_vti_bin/SpellCheck.asmx', '/_layouts/SpellChecker.aspx');
}</script>

<a href="#" onclick="doSpellCheck(); return false;">Test</a>​​​​​​​​​​
2
I got it worked by using the following code .I am answering here so that it might help others.user3476088

2 Answers

1
votes
 <script src="/_layouts/15/core.js?rev=%2FmcwmyWAFSbQRHlXU4BIBg%3D%3D"     type="text/javascript"></script>
<script src="/_layouts/15/bform.js?rev=vpNFu8lw3ualVEnVze6Hhw%3D%3D" type="text/javascript"></script>
<script src="/_layouts/15/spellcheckentirepage.js?rev=tyo1KV6W91uXeSLj34Myzw%3D%3D" type="text/javascript">

</script><script language="javascript" type="text/javascript"> function doSpellCheck() {
SpellCheckEntirePage('/_vti_bin/SpellCheck.asmx', '/_layouts/SpellChecker.aspx');
}
</script><a onclick="doSpellCheck()" href="#"><img alt="Spell Check" src="/Policies/Forms/_layouts/1033/images/RTE2SPCHK.GIF" style="border: 0px
currentcolor;"/>Spellcheck</a>

"

0
votes

I know this is an old post, but people may still be looking for this. I'd like to present you with the solution for the edit properties of a library.

If you are in the edit properties of a library, you can add a button to the form and it will automatically check the spelling of the fields on that page. To do this:

  1. Find the library in Site Contents.
  2. Open the library
  3. On the toolbar, click Library/Form Web Parts then Default Edit Form
  4. Add a content editor web part and in the source add:

<button onclick="Spellcheck(); return false;">Check Spelling</button>

You can also get fancy and add the SharePoint spellcheck image using:
<img src="/_layouts/15/1033/images/spellingHH.png">

This solution will result in checking of multiple textboxes on the edit properties form, onscreen feedback of misspelled words, and a dialog box to check, suggest, replace, and ignore words.