1

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

SilverLight
  • 19,668
  • 65
  • 192
  • 300

2 Answers2

1

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
  • 1,604
  • 17
  • 27
  • 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) – SilverLight Jun 22 '10 at 15:50
  • Modified my answer above to include the code i was suggesting. – Jon Weers Jun 26 '10 at 14:27
0

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
  • 450,073
  • 74
  • 686
  • 939