views:

117

answers:

4

How to style from elements unobtrusively in all browsers including IE6

A: 

Use jQuery. Specifically the toggleClass function and then use CSS classes to style your forms. No plugin required. See jQuery Attributes Documentation.

If you want more styles, check out jQuery UI.

sirlancelot
is there any plugin to make this easily possible
metal-gear-solid
A: 

Use class names for you elements for which you can't apply styles generally in CSS.

rahul
i can't add class to any form elements
metal-gear-solid
@jitendra - you'll have to explain why. If you can't add class to the markup you are severely crippled and if you can't do that why on earth can you add JS or CSS?
annakata
@annakata - yes i can add external js and css but nothing as inline css class, inline style etc
metal-gear-solid
+3  A: 

There are a few plugins that do what you want. Basically, you want to add special styling to forms via javascript + css, but want the form to function normally if javascript is disabled

Here are two such plugins, but I am sure there are more out there:

  1. Uniform for jQuery on Github and The Overview
  2. FancyForm for MooTools
Doug Neiner
you understood absolutely right
metal-gear-solid
Do u know any more jquery plugins. I do not use MooTools.
metal-gear-solid
Sorry, I don't! Uniform was really shaping up to be cool, but I guess Josh got busy because he hasn't updated it since June.
Doug Neiner
Uniform is very cool, but in my case i can't any xhtml <span>Choose</span> and class or ID to form element. I need styling on default html markup of formelements
metal-gear-solid
Oh i just checked uniform Doesn't work on IE6.
metal-gear-solid
A: 

So far i found this is best and works in IE 6+, safari 2+, firefox 2+

http://www.dfc-e.com/metiers/multimedia/opensource/jqtransform/ alt text

metal-gear-solid