nathansmith / formalize

Teach your forms some manners!
http://formalize.me
1.31k stars 120 forks source link

Added support for button tag in jquery #36

Closed cjcheshire closed 13 years ago

cjcheshire commented 13 years ago

Hey

I've added in support for the button tag on the jquery non minified version. See what you think - if you like it will be my first contribution wahoooo!

Chris

nathansmith commented 13 years ago

Not that I don't appreciate the willingness to contribute, but this actually isn't needed.

What this JS is doing is looping through, and disambiguating the many types of input, since IE6 doesn't recognize things like:

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

IE6 only understands:

input {...}

So, JS patches that, by looping through and saying: "Are you one of these?"...

input[type="submit"], input[type="reset"], input[type="button"]

If so, then (in IE6) it is given a class of:

.ie6_button

Whereas, a button tag has no additional type associated with it that would change its visual styling. All these look the same...

button[type="reset"], button[type="submit"], button[type="button"]

So, there's no need to check for the tag name of button. :)

cjcheshire commented 13 years ago

Ah no worries.

I've realised I had some [type] mixed in with the button so ie6 was not playing ball.

Thanks,

Chris

On 26 Oct 2011, at 21:01, Nathan Smith wrote:

Not that I don't appreciate the willingness to contribute, but this actually isn't needed.

What this JS is doing is looping through, and disambiguating the many types of input, since IE6 doesn't recognize things like:

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

IE6 only understands:

input {...}

So, JS patches that, by looping through and saying: "Are you one of these?"...

input[type="submit"], input[type="reset"], input[type="button"]

If so, then (in IE6) it is given a class of:

.ie6_button

Whereas, a button tag has no additional type associated with it that would change its visual styling. All these look the same...

button[type="reset"], button[type="submit"], button[type="button"]

So, there's no need to check for the tag name of button. :)

Reply to this email directly or view it on GitHub: https://github.com/nathansmith/formalize/pull/36#issuecomment-2535573