Forum Moderators: open
What I would like to do is instantly give a visitor the ability to toggle (both add and remove) the spellcheck attribute to an input element (input, textarea, etc).
Some people such as myself may prefer to simply add syntax to the dictionary. Others may find the spellchecker to be useful in half the circumstances they will encounter it. My goal is to let them decide without having to directly change anything in their browser (but of course the page itself instead). This is intended to be a per page script so I'm not looking to use cookies or anything to remember the user's preferences. I'm also going to use serverside code to avoid serving the attribute to anything that does not support it (basically anything but Gecko and especially validators!) plus I plan on having it served based on a user's preference when registered.
I'm still trying to learn how to construct JavaScript and with a lot of awesome coders here I at least have some ideas of what syntax may be used (though feel free to point out why I am wrong about anything that is in my initial perception please).
I know we have to target the element.
document.getElementById("null")
I figure we should make this dynamic in case we want to support multiple input/textarea forms. I have a bit of trouble with dynamic JavaScript.
I figure setting the attribute and value will probably look like...
setAttribute("spellcheck", false);
and...
setAttribute("spellcheck", true);
- John
[edited by: JAB_Creations at 5:24 pm (utc) on Oct. 30, 2006]
Good luck.