#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2003
    Posts
    133
    Rep Power
    12

    Using CSS to make a textfield readonly


    Hi,

    Is it possible to control the the readonly of a textfield in a form with CSS, I tried to add readonly: true; but this does not work.


    my style is:

    .input2 {
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 11px;
    font-style: normal;
    line-height: normal;
    font-weight: normal;
    font-variant: normal;
    text-transform: none;
    color: #000000;
    background-color: #ccddee;
    }

    Any help is welcome.

    Sanjay
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Location
    UK
    Posts
    311
    Rep Power
    11
    As far as I know this is not possible with CSS but a similair workaround is probably possible with javascript.

    I someone does know of a way I would be intersted too.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jan 2002
    Location
    Seattle WA
    Posts
    863
    Rep Power
    14
    No way to do it in CSS, do it in the markup tag or by script.
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2003
    Posts
    133
    Rep Power
    12
    Shame, got a load of textfields that need readonly assigned.

    Thanks,

    Sanjay
  8. #5
  9. No Profile Picture
    Super Moderator
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Jul 2003
    Posts
    4,007
    Rep Power
    2791
    A cheap workaround would be to layer something over it.

IMN logo majestic logo threadwatch logo seochat tools logo