jQuery placeholder plugin
We have moved to using the jQuery plugin placeholder-enhanced for adding placeholders to browsers that don't support them (i'm looking at you IE9).
It seems to work better than the other plugins and libraries out there (we tried placify which had some trouble when pages resized or if forms were hidden in lightboxes).
It looks like placify creates a div with text (and class) positioned above the input element but placeholder-enhanced adds a class to input and then sets value to placeholder text. Both have positives and negatives. I can see why there are less positioning issues with placeholder-enhanced since it doesn't have to figure out the current location of the element to position a new div on top of it.
But the one thing i found interesting was that for password fields, placeholder-enhanced creates an input on top of the password input. Its a clever idea but i found a bug with IE9 (go figure) that by default password inputs w/out size have a set width. I need to patch the placeholder library to check for size of the input that it covers up. I've forked and submitted pull request on github.
The only other thing i'd like with placeholder-enhanced is way to disable adding 'placeholder' class to input elements when browser supports placeholder styling since we don't need that. It should be too tough to create new parameter. Someday :)
__END__
It seems to work better than the other plugins and libraries out there (we tried placify which had some trouble when pages resized or if forms were hidden in lightboxes).
It looks like placify creates a div with text (and class) positioned above the input element but placeholder-enhanced adds a class to input and then sets value to placeholder text. Both have positives and negatives. I can see why there are less positioning issues with placeholder-enhanced since it doesn't have to figure out the current location of the element to position a new div on top of it.
But the one thing i found interesting was that for password fields, placeholder-enhanced creates an input on top of the password input. Its a clever idea but i found a bug with IE9 (go figure) that by default password inputs w/out size have a set width. I need to patch the placeholder library to check for size of the input that it covers up. I've forked and submitted pull request on github.
The only other thing i'd like with placeholder-enhanced is way to disable adding 'placeholder' class to input elements when browser supports placeholder styling since we don't need that. It should be too tough to create new parameter. Someday :)
__END__
Comments
Post a Comment