Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5

Thread: textbox

  1. #1
    0rr
    0rr is offline
    New to the CF scene
    Join Date
    Jun 2002
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    textbox

    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.

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    The Planet Earth Code Poet: True
    Posts
    282
    Thanks
    0
    Thanked 1 Time in 1 Post
    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.

  • #3
    0rr
    0rr is offline
    New to the CF scene
    Join Date
    Jun 2002
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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..

  • #4
    Senior Coder
    Join Date
    Jun 2002
    Location
    UK
    Posts
    1,137
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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
    Spammers next time you spam me consider the implications:
    (1) that you will be persuaded by me(in a legitimate mannor)
    (2)It is worthless to you, when i have finished

  • #5
    Regular Coder
    Join Date
    Jun 2002
    Location
    USA
    Posts
    113
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Code:
    <input type="textbox" style="BORDER: blue 2px solid; FONT-SIZE: large; BACKGROUND: skyblue; COLOR: red; FONT-FAMILY: cursive"></input>
    USA


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •