SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Evangelist jazztie's Avatar
    Join Date
    Mar 2001
    Location
    the Netherlands
    Posts
    519
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    formatting input types?

    Is it possible to format input type?

    For instance: change the background color of a radiobutton, checkbox, text or a textarea...

    Does anyone have a link to a list of all the attributes of a form - inputtypes?

    Please, any help is appreciated!

    Jazz
    Last edited by jazztie; Jun 27, 2002 at 06:48.

  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)
    Yes, you can apply CSS styles to INPUT tags. The elements (should) support all the standard CSS styles.

  3. #3
    SitePoint Evangelist jazztie's Avatar
    Join Date
    Mar 2001
    Location
    the Netherlands
    Posts
    519
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Which elements are supported? And what are all the attributes of the elements?

    Jazz

  4. #4
    SitePoint Enthusiast
    Join Date
    Apr 2002
    Posts
    75
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This should work with both IE5+ and Netscape 6+

    var x=document.getElementsByTagName('input');
    for (i=0;i<x.length;i++){
    if (x[i].getAttribute('type')=='text')
    x[i].style.border='1px solid black';
    if (x[i].getAttribute('type')=='radio'){
    x[i].style.border='0px';
    x[i].style.backgroundColor='transparent';
    }
    if (x[i].getAttribute('type')=='checkbox'){
    x[i].style.border='0px';
    x[i].style.backgroundColor='transparent';
    }
    }

    Also, check out http://www.pxl8.com/styling_inputs.html


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
  •