At my site I a Locked Fields script that demonstrates 2 ways of disabling edits (neither one uses MS's proprietary property for locking) One uses an onmouseover=alert; the other. onfocus http://members.aol.com/grassblad
------------------
Where the world once stood
the blades of grass cut me still
Tom Knight posted this at 05:16 — 8th January 2000.
Another way of doing it, is to have the text in the textarea box to refresh itself every second. Put the following script in the head section
code:
<script language="JavaScript">
<!-- hidden
function noEdit()
{
document.formName.dontEditMe.value="This text should be uneditable"
setTimeout('noEdit()',1000)
}
//-->
</script>
[/code]
Then in the body section:
code:
<form name="formName">
<textarea rows="10" cols="60" name="dontEditMe"></textarea>
</form>
<script language="JavaScript">
<!--
noEdit();
//-->
</script>[/code]
------------------
Do you want to have fun?
TomWorld
The refresh probably would work (never tried it, though) but it would screw up any of the other variables and already clicked-on elements on the page.
Then again, that does give new meaning to maintaining state.
There you are, I thought you hid with the cheese... lol!
Yeah I usually use div's too since I can format it better, but you can also apply css styling to textareas to make it appear like div's so it's reversible... lol!
PaulAdman posted this at 06:41 — 7th October 2008.
I follow the links that you provide in this thread and also follow that code that is in this thread. I think it is very much useful for my professional upgradeable. This is really very informative thread for me.
you can make textarea uneditable by setting the value of the attribute-readonly of the textarea tag as readonly
readonly="readonly"
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.
Tom Knight posted this at 18:40 — 5th January 2000.
They have: 48 posts
Joined: Dec 1999
I don't think that this is possible, isn't the whole point of a textarea box so you can edit it?
------------------
Do you want to have fun?
TomWorld
Do you want to have fun?
TomWorld
Rob Pengelly posted this at 19:01 — 5th January 2000.
They have: 850 posts
Joined: Jul 1999
Tom Knight, not in some cases. I know I have a script where I would rather have the textbox uneditable.
For instance, if a site had a textarea that had html code to link to there site, it would be better if the textarea was uneditable.
Anyhow, Lynn, if you find an answer for this somewhere else, it would be great if you could post the code here.
Thanks.
------------------
Elephants are the only mammals that can't jump.
http://www.thehungersite.com - http://www.therainforestsite.com
http://www.ratemymullet.com - Beauty is only mullet deep.
vox posted this at 07:26 — 6th January 2000.
They have: 8 posts
Joined: Jan 2000
That's a very useful application of a textarea but the original intent was for use in a form, right?
Just commenting, not offering help or something useful like that.
------------------
jinkies
jinkies
Jack Michaelson posted this at 08:31 — 6th January 2000.
He has: 1,733 posts
Joined: Dec 1999
You can use this:
<textarea onfocus="blur()">Yourstuff</textarea>;
But I'm not quite sure this is what you want.
Jack
Tom Knight posted this at 18:37 — 6th January 2000.
They have: 48 posts
Joined: Dec 1999
robp, I suppose you've got a point
------------------
Do you want to have fun?
TomWorld
Vincent Puglia posted this at 03:42 — 8th January 2000.
They have: 634 posts
Joined: Dec 1999
Hi,
At my site I a Locked Fields script that demonstrates 2 ways of disabling edits (neither one uses MS's proprietary property for locking) One uses an onmouseover=alert; the other. onfocus http://members.aol.com/grassblad
------------------
Where the world once stood
the blades of grass cut me still
Tom Knight posted this at 05:16 — 8th January 2000.
They have: 48 posts
Joined: Dec 1999
Another way of doing it, is to have the text in the textarea box to refresh itself every second. Put the following script in the head section
Do you want to have fun?
TomWorld
Vincent Puglia posted this at 23:25 — 9th January 2000.
They have: 634 posts
Joined: Dec 1999
Hi,
The refresh probably would work (never tried it, though) but it would screw up any of the other variables and already clicked-on elements on the page.
Then again, that does give new meaning to maintaining state.
Vinny http://members.aol.com/grassblad
Where the world once stood
the blades of grass cut me still
Tom Knight posted this at 21:30 — 10th January 2000.
They have: 48 posts
Joined: Dec 1999
The refresh works by only refreshing what is in the textarea box, it doesn't refresh the entire page, so any other variables would be fine.
------------------
Do you want to have fun?
TomWorld
Do you want to have fun?
TomWorld
Vincent Puglia posted this at 01:20 — 11th January 2000.
They have: 634 posts
Joined: Dec 1999
Sorry Tom
hate wearing glasses to read from screen, so I never read the code (too small for my eyes).
Vinny http://members.aol.com/grassblad
JP Stones posted this at 05:04 — 11th January 2000.
They have: 2,390 posts
Joined: Nov 1998
...or just put disable in the input tag
(works in IE only)
Jack Michaelson posted this at 10:07 — 12th January 2000.
He has: 1,733 posts
Joined: Dec 1999
Yes, but with 'disabled' in the tag everything turns gray. And I think some people might not want that to happen.
Jack
JP Stones posted this at 11:28 — 12th January 2000.
They have: 2,390 posts
Joined: Nov 1998
true, in that case the onFocus is your best bet.
JP
mydelf posted this at 17:46 — 3rd October 2008.
They have: 1 posts
Joined: Oct 2008
code:
Yourstuff
[/code]
But I'm not quite sure this is what you want.
Jack
Shakespeare: onclick or not(onclick)
thanks Jack Michaelson!!!...it did help me...more powers!!! GOD BLESS ALWAYS
JeevesBond posted this at 11:25 — 4th October 2008.
He has: 3,956 posts
Joined: Jun 2002
Wow, this is an old topic. Glad it helped you though mydelf.
Welcome to the forums!
demonhale posted this at 09:12 — 5th October 2008.
He has: 3,278 posts
Joined: May 2005
blast from the past... I wonder where JM is...
Jack Michaelson posted this at 14:13 — 6th October 2008.
He has: 1,733 posts
Joined: Dec 1999
right here
By the way: Nowadays I wouldn't use a textarea, but making a div look like one.
demonhale posted this at 04:17 — 7th October 2008.
He has: 3,278 posts
Joined: May 2005
There you are, I thought you hid with the cheese... lol!
Yeah I usually use div's too since I can format it better, but you can also apply css styling to textareas to make it appear like div's so it's reversible... lol!
PaulAdman posted this at 06:41 — 7th October 2008.
They have: 40 posts
Joined: Aug 2008
You should use java script and style sheet on particular Text box. It will very helpful for you and use blur.
raleighvon posted this at 22:33 — 7th October 2010.
They have: 1 posts
Joined: Oct 2010
Using JavaScript to prevent editing a textfield is a very roundabout way to solve a simple problem because textarea has an attribute called readonly.
Used like this:
<textarea readonly="readonly"></textarea>
freddavis posted this at 17:40 — 27th October 2010.
They have: 22 posts
Joined: Oct 2010
You can add disabled="true" to , but then its name/value pair won't be submitted when the form is submitted.
Thanks
admsbrwn posted this at 05:30 — 28th December 2010.
They have: 5 posts
Joined: Dec 2010
I follow the links that you provide in this thread and also follow that code that is in this thread. I think it is very much useful for my professional upgradeable. This is really very informative thread for me.
Reverse cell phone number
lisaroy1 posted this at 06:43 — 25th January 2011.
They have: 46 posts
Joined: Jan 2011
you can make textarea uneditable by setting the value of the attribute-readonly of the textarea tag as readonly
readonly="readonly"
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.