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 8 of 8
  1. #1
    Regular Coder bacterozoid's Avatar
    Join Date
    Jun 2002
    Location
    USA
    Posts
    490
    Thanks
    24
    Thanked 35 Times in 35 Posts

    Question Disable Text Box Editing

    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?

  • #2
    jkd
    jkd is offline
    Senior Coder jkd's Avatar
    Join Date
    May 2002
    Location
    metro DC
    Posts
    3,163
    Thanks
    1
    Thanked 18 Times in 18 Posts
    readonly="readonly"

  • #3
    Senior Coder
    Join Date
    Jul 2002
    Posts
    1,628
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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>
    Last edited by cg9com; 10-13-2002 at 07:46 AM.

    Moderator: General web building

    Get out from under them, resist and multiply.
    Get out from under precipice and see the sky.

  • #4
    jkd
    jkd is offline
    Senior Coder jkd's Avatar
    Join Date
    May 2002
    Location
    metro DC
    Posts
    3,163
    Thanks
    1
    Thanked 18 Times in 18 Posts
    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.

  • #5
    Regular Coder bacterozoid's Avatar
    Join Date
    Jun 2002
    Location
    USA
    Posts
    490
    Thanks
    24
    Thanked 35 Times in 35 Posts
    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!

  • #6
    Senior Coder
    Join Date
    Jul 2002
    Posts
    1,628
    Thanks
    0
    Thanked 0 Times in 0 Posts
    *jkd* aaaaaahhh

    Moderator: General web building

    Get out from under them, resist and multiply.
    Get out from under precipice and see the sky.

  • #7
    Senior Coder
    Join Date
    Jun 2002
    Location
    Wichita
    Posts
    3,880
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #8
    Regular Coder bacterozoid's Avatar
    Join Date
    Jun 2002
    Location
    USA
    Posts
    490
    Thanks
    24
    Thanked 35 Times in 35 Posts
    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


  •  

    Posting Permissions

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