Guest User

Untitled

a guest
Aug 18th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. How to set the selected value of a (ajax) combobox with jquery
  2. function VeriYaz(id) {
  3. $.ajax({
  4. type: "GET",
  5. url: "VeriAl.aspx",
  6. data: "id=" + id,
  7. async: false,
  8. success: function (data) {
  9. var urunler = data.split('|');
  10. document.getElementById('<%= cmbkategori.ClientID %>').value = stripHTML1(urunler[0]);}
  11. });
  12. }
  13.  
  14. $("#<%=DropDownList1.ClientID%>").val("1");
  15.  
  16. $("#<%=DropDownList1.ClientID%>").val(stripHTML1(urunler[0]));
  17.  
  18. $("#<%=DropDownList1.ClientID%> option:contains(" + stripHTML1(urunler[0]) + ")").attr("selected", "selected");
  19.  
  20. $find("<%=ComboBox1.ClientID%>").get_textBoxControl().value = stripHTML1(urunler[0]);
Add Comment
Please, Sign In to add comment