views:

42

answers:

2

hi my dear friends :

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...

A: 

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

Tim Schmelter
it seems to be : $find("<%=RadAjaxManger1.ClientID %>").ajaxRequest("");but not work...can u explain more!
LostLord
Dont have experiences with RadAjaxmanager - > try it (it is the best)
LostLord
A: 

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.

Jon Weers
can u give me an example in javascript...(i can not use onload of my form - because i have a timer in my form that ticks every 6 seconds - using onload couses to set my button to disable every time that timer fires)
LostLord
Modified my answer above to include the code i was suggesting.
Jon Weers