Fix drop-down lists in IE9.

Change-Id: Id61d723444d7075c32172f2745acb1ce9d9563e7
Closes-bug: #1235197
This commit is contained in:
Timur Sufiev 2013-10-24 16:25:41 +04:00
parent 78eb046e14
commit 604b17e20a
1 changed files with 10 additions and 2 deletions

View File

@ -12,6 +12,10 @@
License for the specific language governing permissions and limitations
under the License.
*/
/* The fix was borrowed from
http://www.hagenburger.net/BLOG/HTML5-Input-Placeholder-Fix-With-jQuery.html
*/
$(function() {
var get_IE_version = function() {
if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)) { //test for MSIE x.x;
@ -20,9 +24,13 @@ $(function() {
}
}
if (get_IE_version() < 10) {
// placeholder attribute for optional drop-down fields doesn't work
// very well together with this fix - so remove placeholder
// attribute for every drop-down list.
$('select').filter('[placeholder]').removeAttr('placeholder');
$('[placeholder]').focus(function() {
var input = $(this);
if (input.val() == input.attr('placeholder')) {
var input = $(this);
if (input.val() == input.attr('placeholder')) {
input.val('');
input.removeClass('placeholder');
}