Howdy all,
If I have a textbox, such as:
I know I can add a readonly attribute to it to lock it down, such as:Code:<textarea name="mytext" id="mytext" rows="2" columns="50">
Question is this: via JavaScript, can I set this textarea as READONLY?Code:<textarea READONLY name="mytext" id="mytext" rows="2" columns="50">
What I'm trying to accomplish here is that after a user enters their text into the <textarea>, when they click a certain button, I'd like to lock down the textarea as READONLY via a JavaSript thereby locking their comments.
This obviously doesn't work:
I know I'm missing something here (see red):Code:function lockit() { document.getElementByID('mytext') = READONLY; }
...but can't figure out what and haven't been able to successfully Google search either...Code:function lockit() { document.getElementByID('mytext')._____ = READONLY; }
Any help would be greatly appreciated...
Thanks,
- I



Reply With Quote


Bookmarks