57 users online (1 members and 56 guests)  


  Results 1 to 6 of 6

Related

  1. Moving elements    Forum: Javascript Forum
    Replies: 4
  2. CSS, styles and PHP    Forum: CSS Forum
    Replies: 1
  3. Block elements within inline elements    Forum: CSS Forum
    Replies: 6
  4. tekno elements    Forum: Show it off!
    Replies: 7
  1. #1
    Empier4552's Avatar
    New User

    Status
    Offline
    Join Date
    Aug 2002
    Posts
    1

    Styles for forms and elements

    Hey. right now I have a form. One area is a text area. However it will already contain text and i'd like to make it non-writeable. I've seen thisdone in other places though I cannot recall where and am pretty sure it was a CSS value which defined weather or not I could write to it

  2. #2
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    Hello there.

    To make a form element read-only, add readonly to the tag -

    Code:
    <textarea cols="30" rows="10" name="bob" readonly>
    blah badger blah
    </textarea>
    That will do it.
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?

  3. #3
    benzden's Avatar
    Senior Member

    Status
    Offline
    Join Date
    Feb 2002
    Location
    San Antonio, Texas
    Posts
    652
    As usual, thanks for the tips, QuietDean.

    I've just added variations of each at

    http://test.gumint.com and

    http://tests.gumint.com


    Now, is there any way to eliminate that unneeded scrollbar
    to the right of the window?

    The borders?

    Changing the border colors?

  4. #4
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    I had a play, the scroll bars are not rendered if not needed in Mozilla, but I found a workaround for IE (tested in 6) which should work. The border is in there, too -

    Code:
    <form NAME="example">
    <textarea COLS="56" ROWS="1" READONLY STYLE="background:#ffffe0; color:#8b0000;
    font-family: verdana; font-size:14px; padding-left: 6px; padding-right: 6px; text-decoration:none; overflow: hidden; border: 5px dashed #000069;">
    Secondary SCRIPTs, STYLEs and TABLEs test page.
    </textarea></form>
    Form elements are always the trickiest to style, if it can be avoided, then avoid it
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?

  5. #5
    benzden's Avatar
    Senior Member

    Status
    Offline
    Join Date
    Feb 2002
    Location
    San Antonio, Texas
    Posts
    652
    Merci beaucoup, QuietDean. You are a MASTER of your craft.

    Now, the test pages show what is possible with this "quick and dirty" trick that uses a FORM for something for which it wasn't designed - much as a screw driver for opening a can of paint -- the types of tricks and techniques that make my own internet life much more interesting and enjoyable.

    This is something I definitely will be using on various pages to display just such a disclaimer, entry notice or other user friendly text 'box' that stands out on the page "without the borders" that sometimes detract from it. ( It'll also make other webmasters wonder how it was done. )

  6. #6
    NyorexDC's Avatar
    New User

    Status
    Offline
    Join Date
    Feb 2009
    Posts
    1

    Talking Re: Styles for forms and elements

    OMG.. thank you so much.. actually i only registered, to thank you... you really are a master



Tags for this Thread