Wednesday, 15 February 2012

c# 4.0 - How to disable an Ajax Combobox on the text change of another Ajax Combobox? -



c# 4.0 - How to disable an Ajax Combobox on the text change of another Ajax Combobox? -

i acheiving via postback adding delay @ server want handle on client side. can guide me how disable 1 combobox on clientside event of combobox.

i have done far:

function enable() { alert("gfugsdugfsduigf"); var ddl3 = document.getelementbyid("cmbx1"); var ddlvalue3 = ddl3.options[ddl3.selectedindex].value; if (ddlvalue3 == "1") { document.getelementbyid('<%=cmbx2.clientid%>').disabled = false; } else { document.getelementbyid('<%=cmbx2.clientid%>').disabled = true; } }

in page load writing:

cmbx1.attributes.add("onchange", "enable();");

but no success, command not going function when debug.

something maybe... ?

function pageload() // automatically called (and necessary utilize when working comboboxes) { // add together alter event cmbx1 $find("<%=cmbx1.clientid%>").add_propertychanged( function (sender, e) { if (e.get_propertyname() == 'selectedindex') { cmbx1_onchange(); } }); } function cmbx1_onchange() { // selected value of box 1 var cmbx1value = $find("<%=cmbx1.clientid%>").get_textboxcontrol().value; // enable box 2 if selected value of box 1 1, else disable $find("<%=cmbx2.clientid%>").get_textboxcontrol().disabled = cmbx1value != 1; $find("<%=cmbx2.clientid%>").get_buttoncontrol() .disabled = cmbx1value != 1; }

except without indentation stripped

ajax c#-4.0 combobox disabled-control

No comments:

Post a Comment