...

View Full Version : Disable Text Box Editing



bacterozoid
10-12-2002, 11:15 PM
Alright, on my site, I want to have a text box with some text entered into it...basically avoiding using Iframes, but is there a tag I can add to the text box properties that will disable a page viewer from changing information inside of the text box? I am sure I have seen it before, but I can't find a site that tells me how to do it. Possibly a JavaScript?

jkd
10-12-2002, 11:21 PM
readonly="readonly"

cg9com
10-13-2002, 07:43 AM
or <textarea disabled></textarea>

that will gray out the area

readonly will keep everything the same

<edit>now that i think about it, you only have to type readonly instead of readonly="readonly" but both will work fine</edit>

jkd
10-13-2002, 05:03 PM
Originally posted by cg9com
<edit>now that i think about it, you only have to type readonly instead of readonly="readonly" but both will work fine</edit>

Not if you want XHTML compliance.

bacterozoid
10-13-2002, 05:08 PM
Thanks for the help! Using the disabled part greys out the text, and the readonly tag just disables any editing, nothing is greyed out. Now all I need to do is challenge myself into making the textbox value change when I click on a link...simple, lol. Thanks!

cg9com
10-14-2002, 05:21 AM
*jkd* aaaaaahhh

Roy Sinclair
10-14-2002, 04:40 PM
Originally posted by bacterozoid
Thanks for the help! Using the disabled part greys out the text, and the readonly tag just disables any editing, nothing is greyed out. Now all I need to do is challenge myself into making the textbox value change when I click on a link...simple, lol. Thanks!

Just remember, the disabled attribute makes the textbox unchangeable and it won't be submitted while readonly makes it unchangeable but it will still submit.

bacterozoid
10-15-2002, 02:40 AM
Hmm, yes, I shall keep that in mind, but I don't believe that will ever come in handy...unless for some kind of a guestbook prank where I want to force someone to submit something I specify, lol. Thanks :)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum