Click here to Skip to main content
15,887,425 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear sir
I want to fill dropdown on other dropdown selected index changed event in a mobile application. dropdwon binding code is following.
    <script type="text/javascript">
        function drpbrandChange(id) {
            ShowModels(document.getElementById(id).value);
        }
      function ShowModels(CarSefUrl) {
      var param = { _CarSefUrl: CarSefUrl };
      var data2;
            var _url = "JSON/GetCarModelThroughCarSefUrl_New";
            var _data = param;
            
                var result = null;
                $.ajax({
                    url: _url,
                    cache: false,
                    async: false,
                    data: _data,
                    success: function (data) 
                    {
                        result = data;
                    },
                    dataFilter: function (data) 
                    {
           if (typeof (JSON) != 'undefined' && typeof (JSON.parse) == 'function')
                            if (typeof (JSON.parse(data)) == "object")
                                data2= JSON.parse(data);
                            else
                                data2 = data;
                        else
                            data2 = eval('(' + data + ')');
                    },
                    error: function () 
                    {
                        result = false;
                    }
                });
                
            
            if (data2 != undefined) {
                var items = "<option value=\"\">Select Model...</option>";
                var obj = "#drpModel";
                if (data2 != null) {
                    $.each(data2, function (i, data2) {
items += "<option value=" + data2["ModelName"] + ">" + data2["ModelSefUrl"] + "</option>";
                    });
                    $(obj).html(items);
                }
            }
        }
    </script>



this code is executing successfully in desktop but not working properly in mobile this code is executing some rare case. I test in samsung,blackbarry and endroid mobile phone.

Thanks in advance.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900