Skip to:
Content
Pages
Categories
Search
Top
Bottom

Add class to input type="submit" in core files


  • peterverkooijen
    Participant

    @peterverkooijen

    Question to the developers, probably Andy:

    Would it be possible to add class=”button” (or something like that) to any input type=”submit” in core files, to make them easier to style via CSS?

    I’ve tried using ‘submit’ as selector in CSS, but that doesn’t seem to work.

Viewing 7 replies - 1 through 7 (of 7 total)

  • Suzanne
    Participant

    @ahjira

    Peter I’ve used a JavaScript solution to auto-insert that class on input buttons. I can’t remember if this is the one… looks familiar. It’s an option.

    http://www.dustindiaz.com/input-element-css-woes-are-over/


    Bowe
    Participant

    @bowromir

    Thanks that’s a great tip Suzanne!


    Xevo
    Participant

    @xevo

    Actually that’s a bad idea, if someone has it’s javascript turned off for some reason, it won’t have that extra class. It’s better to code it into your forms. Also, make a ticket in the trac for this, sounds like an easy fix. Will make it easier for designers to style their forms in the future.

    I think the less HTML in the core, the better. You can already select submit buttons using CSS. Like this:

    input[type="submit"] { blah blah blah }

    Probably doesn’t work in any version of Explorer. LOL. But who cares. Let the IE people see an ugly (but still functional) button.

    http://www.w3schools.com/css/css_attribute_selectors.asp


    Xevo
    Participant

    @xevo

    @ David: Fun way to say no to IE, but still more than the half of the web users, use Internet Explorer, so not really an option in my opinion. You could use both though, the javascript for IE and the css method for the other browsers.


    peterverkooijen
    Participant

    @peterverkooijen

    I’d finally discovered the solution David Lewis mentioned. It seems to work in most modern browsers, including the latest IE. And Suzanne’s Javascript solution covers the rest.

    So this is resolved. Forget I asked…

    @Xevo. That’s a personal choice of course. My view is that it’s just a button. It would be nice to have it look just as pretty in IE6/7. But it still works. You’re not breaking anything. I actually still support IE6+ in all my work. That’s more than a lot web developers these days (lots of people are dropping IE6). But when it comes to minor aesthetic issues that don’t affection functionality… I don’t fret too much. That’s the price you pay for using an inferior browser. Frankly. And again… it’s a small price. The only thing I don’t fret about are minor things like rounded corners, pretty buttons, etc.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Add class to input type="submit" in core files’ is closed to new replies.
Skip to toolbar