How to set the 'selected option' of a select dropdown list with jquery

后端 未结 6 1506
南笙
南笙 2021-01-31 09:07

I have the following jquery function:

$.post(\'GetSalesRepfromCustomer\', {
    data: selectedObj.value
}, function (result) {
    alert(result[0]);
    $(\'sele         


        
6条回答
  •  天涯浪人
    2021-01-31 09:25

    The match between .val('Bruce jones') and value="Bruce Jones" is case-sensitive. It looks like you're capitalizing Jones in one but not the other. Either track down where the difference comes from, use id's instead of the name, or call .toLowerCase() on both.

提交回复
热议问题