I have a gridview with row selection which should set the page’s elements value by the selected id… When I press the row, I want my (ajax-editable)combobox to change its value(index) by the data turning from async page. I tried almost everything… Please need urgent help… 🙁
function VeriYaz(id) {
$.ajax({
type: "GET",
url: "VeriAl.aspx",
data: "id=" + id,
async: false,
success: function (data) {
var urunler = data.split('|');
document.getElementById('<%= cmbkategori.ClientID %>').value = stripHTML1(urunler[0]);}
});
}
You can use the
val([value])function to set the selected value with jQuery:EDIT
If you want to set the selected value based on the data returning from your AJAX call, you should be able to do this:
To set the selected item by the text, you can do this:
EDIT
It sounds like you’re using the AJAX Toolkit ComboBox, in which case you can try something like this: