PDA

View Full Version : textbox


0rr
06-17-2002, 05:28 PM
is there a javascript code for a locked text box?

i use geocities and their text boxes dont lock text, meaning that if you are viewing it you can edit the text within.

JohnKrutsch
06-17-2002, 06:37 PM
With IE4+ and NS6 you simply use:

document.FormName.ElementName.disabled=true;

For older browsers you will have to make it so the box can't receive focus.

0rr
06-19-2002, 05:35 PM
thanks for the help, i was able to lock it

however, i have another question

is it possible to edit the font/style/size and background color of the text box?

i only know a little html.. :(

scroots
06-19-2002, 07:12 PM
it can be done, although i am not good with things like this.
you can also lock a textbox by adding readonly into the textbox tag.


scroots

landon11
06-19-2002, 09:31 PM
<input type="textbox" style="BORDER: blue 2px solid; FONT-SIZE: large; BACKGROUND: skyblue; COLOR: red; FONT-FAMILY: cursive"></input>