Select Dropdown is not working in IE8

Select Dropdown is not working in IE8

Hi All,

I have lot of Select Dropdowns in my application web pages. Some of them Have longer text as options. In Ie8 all the longer text is cutting off. I tried some options...Here is my code below.. I tried doing like this my code works if I specify to the particular select dropdown with specific Id.. When I apply this code for all my select dropdowns..all the dropdown are breaking and messing up with the styles...I have different kinds of select dropdowns in my web pages with different widths..How Can I implement this code for all the select dropdowns that I have ? Could anyone please help me regarding this issue?


  1. var isIE = navigator.userAgent.toLowerCase().indexOf("msie");

     

    function setWidthToAuto(drpLst) {

           if (isIE > -1) {

                  drpLst.style.width = 'auto';

           }

    }

     

    function resetWidth(drpLst) {

           if (isIE > -1) {

                  drpLst.style.width = 'inherit';

           }

    }

    $(document).ready(function () {

          

     

           $("select#ddlPolicyEndList").css("width", "inherit").parent().css({ "width": "inherit", "overflow": "hidden","position":"absolute", "left": "0" });

           $("select").attr("onchange", "resetWidth(this)");

           $("select").attr("onblur", "resetWidth(this)");

           $("select").attr("onmousedown", "setWidthToAuto(this)");

     

          

    });