For times when a spell check is over kill! Many of us have over a period of time acquired some bad typing habits and we mis-spell some common word like typing 'teh' for 'the' and 'taht' instead of 'that'. Going back and correcting every instance of this mistake can be very frustrating - so rather than change habit here is a jQuery plugin which will auto-correct such mistakes as you type
Take a look at the Demo
Works with jQuery-1.3.2 on all latest versions of major browsers like Firefox, Seamonkey, Chrome, IE, Safari, Opera etc.
Usage
Include plugin file in your page after the jQuery file
Configure your textboxes/textareas something like
-
$(document).ready(function()
-
{
-
$("#textbox1").autocorrect();
-
-
$("#textbox2").autocorrect({
-
corrections: {
-
arent: "aren't",
-
aboutit: "about it"
-
}
-
});
-
-
$("#textarea").autocorrect({ corrections: { aboutit: "about it" } });
-
});
As you see, first textbox has auto-correct attached with no options, second with 'arent' (which already exists in default options but you can over-write it) and 'aboutit' (this is new one which does not exist in default corrections) then third one is textarea
Download : here
I've noticed a small bug with this extremely useful plug in. If you type the word 'watch' it will return a named function converted to a string!
My fix is to add the following at line 143 in jquery.autocorrect-1.0.js:
if((typeof stringToReplace) == 'function') { return; }
Will this work with contentEditable elements as well as textboxes and textareas?
Try and let us know
It does not work as is. I am making some changes to see if i can get it working...
Thanks for testing - once again let us know if you get it working