开发者

Why this select value can only retrieve once on firefox, It's working normally in IE9

I have this code,

<!-- select customer -->
<div id="select-cust">

    <h4 style="margin: 85px 0 5px 0;">Select Customer:</h4>开发者_Go百科
    <select name="select_cust_id" id="cust_id" class="target">
        <option value="">-- Select Customer --</option>

                    <option value="200020">cust1</option>
                    <option value="200022">cust2</option>
                    <option value="200023">cust3</option>
                    <option value="200030">cust4</option>
                    <option value="200032">cust5</option>
                    <option value="200033">cust6</option>

    </select>

    <script type="text/javascript"> 
    $(document).ready(function() {
        $('#table-vm').hide();
    });

    $(function () {
        $("#cust_id").selectbox();
    });

    $('.target').change(function() {
        var cust_id = $("select#cust_id").val();
        var dataString = 'cust_id='+ cust_id; 

        $.ajax({  
              type: "POST",
              url: "ajax/show_list_vm", 
              data: dataString,  
              success: function(response) {
                $('#table-vm').show(800).html(response).append(cust_id);
              }  
        });  

    });

    </script>
</div>


<!-- table customer -->
<div id="table-vm">

</div>

When I implement this program on IE9 it's working just like I want to. If you click the drop down menu, the function 'change' trigger and show value of response which is 'cust_id' (ex:200020). whenever I change the dropdown menu, the value changed.

but, when I use it in firefox, the value change show is normal until I click back to that value that had clicked before. nothing changed. so I must refresh.

in Opera, the Javascript is not working.

So, why it isn't working in firefox? only working in the first click only, and why it isn't working at all at opera?

Thanks in advance :)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜