Posted
on Nov 19, 2008
(permalink)
My current scenario for spell check is, i want to use the SpellCheck method inside a loop and for each item in loop i want to check whether it has got any spelling mistakes or not. result if i try to do this is that it only takes the last item in the loop and displays the spelling check message. Here is the code below that i am trying.
var Texttocheck ='This is a Test';
var spellservice = window["SpellCheckService1"]; for(var i = 5; i > 0; i--) { spellservice.SpellCheck(Texttocheck + i, function (sender, args) { alert(sender); if (args && args.BadWords && args.BadWords.length > 0) { alert('Mistake'+i); } else { alert('Fine'); } } ); }