I have 4 combobox in a page and i am using update panel.
When i select "Home address", "office address", etc from 1st combo,
address details are not showing in other combos. whenever code is being executed.
function onCustomerAddress_Loaded(result) {
try {
var rows = result.rows[0];
if (rows != null) {
$get(
'<%=txtHCZipCode.ClientID %>').value = rows.ZIPCODE;
$get(
'<%=txtHCStreet.ClientID %>').value = rows.STREET;
$get(
'<%=txtHCZipCode.ClientID %>').disabled = true;
$get(
'<%=txtHCStreet.ClientID %>').disabled = true;
if ($find('<%=cmbHCCountry.ClientID %>').findItemByValue(rows.COUNTY) != null) {
//$find('<%=cmbHCCountry.ClientID %>').clearSelection();
$find(
'<%=cmbHCCountry.ClientID %>').updateClientState();
$find(
'<%=cmbHCCountry.ClientID %>').findItemByValue(rows.COUNTY).select();
//$find('<%=cmbHCCountry.ClientID %>').commitChanges();
$find(
'<%=cmbHCCountry.ClientID %>').disable();
}
else if ($find('<%=cmbHCCountry.ClientID %>').findItemByText("Select") != null) {
$find(
'<%=cmbHCCountry.ClientID %>').clearSelection();
$find(
'<%=cmbHCCountry.ClientID %>').findItemByText("Select").select();
}
if ($find('<%=cmbHCState.ClientID %>').findItemByValue(rows.STATE) != null) {
//$find('<%=cmbHCState.ClientID %>').clearSelection();
$find(
'<%=cmbHCState.ClientID %>').updateClientState()
$find(
'<%=cmbHCState.ClientID %>').findItemByValue(rows.STATE).select();
//$find('<%=cmbHCState.ClientID %>').commitChanges();
$find(
'<%=cmbHCState.ClientID %>').disable();
}
if ($find('<%=cmbHCCity.ClientID %>').findItemByValue(rows.CITY) != null) {
// $find('<%=cmbHCCity.ClientID %>').clearSelection();
$find(
'<%=cmbHCCity.ClientID %>').findItemByValue(rows.CITY).select();
//$find('<%=cmbHCCity.ClientID %>').commitChanges();
$find(
'<%=cmbHCCity.ClientID %>').disable();
}
if ($find('<%=cmbHCLocation.ClientID %>').findItemByValue(rows.location) != null) {
//$find('<%=cmbHCLocation.ClientID %>').clearSelection();
$find(
'<%=cmbHCLocation.ClientID %>').findItemByValue(rows.location).select();
//$find('<%=cmbHCLocation.ClientID %>').commitChanges();
$find(
'<%=cmbHCLocation.ClientID %>').disable();
}
if (rows.PHONE != null) {
$get(
'<%=txtHCPhoneNo.ClientID %>').value = rows.PHONE;
$get(
'<%=txtHCPhoneNo.ClientID %>').disabled = true;
}
}
// if ($get('dvLoading') != null) {
// $get('dvLoading').style.display = 'none';
// }
return false;
}
catch (e) {return false;
}
}
function
HMC_Country_SelectedIndexChanged(sender, args) {
try {
if (locationArray != null) {
var country;
var stateControl;
country = $find(
"<%= cmbHCCountry.ClientID%>").get_value();
stateControl = $find(
"<%= cmbHCState.ClientID%>");
stateControl.clearSelection();
if (stateControl != null) {
stateControl.get_items().clear();
stateControl.commitChanges();
comboItem =
new Telerik.Web.UI.RadComboBoxItem();
comboItem.set_text(
"Select");
comboItem.set_value(
"");
stateControl.get_items().add(comboItem);
for (var rowIndex = 0; rowIndex < locationArray.rows.length; rowIndex++) {
if (locationArray.rows[rowIndex].crm_sug_country == country) {
if (stateControl.findItemByValue(locationArray.rows[rowIndex].crm_sug_state_code) == null) {
comboItem =
new Telerik.Web.UI.RadComboBoxItem();
comboItem.set_text(locationArray.rows[rowIndex].crm_sug_state);
comboItem.set_value(locationArray.rows[rowIndex].crm_sug_state_code);
stateControl.get_items().add(comboItem);
}
}
}
stateControl.commitChanges();
if (stateControl.findItemByText("Select") != null) {
stateControl.findItemByText(
"Select").select();
}
}
}
return false;
}
catch (e) {return false;
}
}
Please help....
Thanks & Regards
Brijendra Pandey