SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    Sultan of Ping jofa's Avatar
    Join Date
    Mar 2002
    Location
    SvÝ■jˇ­
    Posts
    4,080
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    css selector for <input>

    I just realized that the css selector input[type="submit"] isn't working in IE (only in Mozilla)
    Is using input.submit (and then <input class="submit" type="submit" ...>) the only way to solve this problem?

  2. #2
    (****** or Deleted)
    Join Date
    May 2002
    Location
    Melbourne, Australia
    Posts
    299
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I do believe so...

  3. #3
    SitePoint Wizard Ian Glass's Avatar
    Join Date
    Oct 2001
    Location
    Beyond yonder
    Posts
    2,384
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    IE has extremely crappy support for CSS selectors, IMHO. The only way you're going to get it to work is to use classes. :-(

    Hopefully by v7 they'll have remedied that problem!

    ~~Ian

  4. #4
    SitePoint Zealot
    Join Date
    Jan 2002
    Posts
    178
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    um no, actually, IE has a great compatibility rate with CSS. Netscape and Opera couldn't top IE when CSS first came out. For one, Opera didnt support the ID selector AND Netscape didn't support things like border-left, etc. NS also didn't support background-fixed, background-repeat, and much others. While NS had buggy problems with these things, IE4 had already perfected most of them. IE has greate support, NS and Opera just need to catch up.
    InQuE

  5. #5
    SitePoint Wizard Ian Glass's Avatar
    Join Date
    Oct 2001
    Location
    Beyond yonder
    Posts
    2,384
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    They have... ;-)

    ~~Ian
    Last edited by Ian Glass; Sep 11, 2002 at 18:15.

  6. #6
    SitePoint Zealot
    Join Date
    Jan 2002
    Posts
    178
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok well. im wrong damn! DIE ME YOU BANNED FROM POSTING CAUSE YOU CANT EVEN GET INFO RIGHT!
    InQuE

  7. #7
    SitePoint Enthusiast
    Join Date
    Apr 2002
    Posts
    75
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Back to the question at hand, rather than putting a class in each input, you can apply them dynamically.

    var x=document.getElementsByTagName('input')
    for (i=0; i<x.length;i++) {
    if (x[i].getAttribute('type')=='checkbox') {
    x[i].className='myCheck';
    }
    if (x[i].getAttribute('type')=='radio') {
    x[i].className='myRadio';
    }
    if (x[i].getAttribute('type')=='text') {
    x[i].className='myText';
    }
    if (x[i].getAttribute('type')=='submit') {
    x[i].className='mySubmit';
    }
    if (x[i].getAttribute('type')=='button') {
    x[i].className='myButton';
    }
    }

  8. #8
    Sultan of Ping jofa's Avatar
    Join Date
    Mar 2002
    Location
    SvÝ■jˇ­
    Posts
    4,080
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Wow, that's shorter than inserting class="submit" into the only submit button in the form

    No, seriously, that javascript can be very useful for input[type="text"] etc.


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
  •