Using Ryan Faits Custom Inputs with Multiple Classes
Ryan Fait has done a really good write up with a pretty solid chunk of code for customising checkboxes, radio buttons and dropdowns using javascript/css. The one thing that bugged me was if you needed more than one class on your input (in my case, i needed both the 'styled' class and a 'required' class to use jQuery Validate with Custom Inputs), but if you had more than one class on your input the script wouldn't fire.
Change this:
inputs[a].className == "styled"
To this:
inputs[a].className.indexOf("styled") != -1
The original problem is he only caters for if the class is one string of 'styled' by itself, this update checks if the string 'styled' is anywhere in the class.









