SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Evangelist
    Join Date
    Feb 2000
    Location
    England
    Posts
    568
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    setting CSS for disabled form elements

    Does anyone know if it is possible to set the CSS for disabled form elements. I really want to "grey" out the input boxes because with my current CSS you can't tell the element is disabled.

    Any ideas?

    Thanks.

  2. #2
    morphine for a wooden leg randem's Avatar
    Join Date
    Jun 2002
    Location
    .chicago.il.us
    Posts
    957
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    var enabled_bg = '#FFF';
    var enabled_fg = '#000';
    var disabled_bg = '#CCC';
    var disabled_bg = '#333';
    
    function disable(elem){
      elem.disabled = true;
      elem.style.backgroundColor = disabled_bg;
      elem.style.color = disabled_fg;
    }
    function enable(elem){
      elem.disabled = false;
      elem.style.backgroundColor = enabled_bg;
      elem.style.color = enabled_fg;
    }
    ----Adopt-a-Sig----
    Your message here!

  3. #3
    SitePoint Evangelist
    Join Date
    Feb 2000
    Location
    England
    Posts
    568
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    arr.. i see. thanks


Bookmarks

Posting Permissions

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