how disable / enable An Ajaxifeid Button From Client Side (JavaScript)
i have an AJAXIFIED button(btnsend) thas is disable by it's Property -> Enabled="False"
i have a TextBox Next To This Button And I Want Enable that Button When Users Type Something in That TextBox...
so i did this (JavaScript):
function onkeyupontextbox() {
var btnSend = document.getElementById("btnSend");
btnSend.disabled = false;
}
but that button does not work after开发者_如何学编程 becomes enable...
what can i do about that?
(i am using radajaxmanager for ajaxify that button) (when i remove that button from RadAjaxmanager Or UpdatePanel So EveryThing Is Ok , But I Want That Button In Ajaxify Mode)
thanks for your attention...
Sounds like you're trying to mix Ajaxified properties and DOM element properties. Leave the property Enabled = "True" when you ajaxify it, then use JS on page load to btnSend.disabled = true it. If you use pure js to disable it the function you have above should work fine to re-enable it. For example, if the ajaxify property 'Enabled' is set to true, then place the following javascript into your page:
window.onload = function(){
document.getElementById("btnSend").disabled = true;
};
Then use the function you wrote above to enable it onkeyupontextbox(). Because javascript is disabling the button, it should be able to re-enable it. Before, you were disabling with the Ajaxified property and trying to re-enable with js.
Could following be the answer? (Dont have experiences with RadAjaxmanager)
function EnableBtnSend()
{
$find("<%=btnSend.ClientID %>").ajaxRequest("");
}
Found here: http://www.telerik.com/help/aspnet-ajax/grdenabledconventions.html
精彩评论