如何从客户端禁用/启用 Ajaxifeid 按钮 (JavaScript)
我有一个 AJAXIFIED 按钮(btnsend),它被它的属性禁用 -> Enabled =“False”
我在这个按钮旁边有一个文本框,我想当用户在该文本框中键入内容时启用该按钮...
所以我这样做了(JavaScript):
function onkeyupontextbox() {
var btnSend = document.getElementById("btnSend");
btnSend.disabled = false;
}
但是该按钮在启用后不起作用...
我能做什么呢?
(我正在使用 radajaxmanager 来 ajaxify 该按钮) (当我从 RadAjaxmanager 或 UpdatePanel 中删除该按钮时,一切都正常,但我希望该按钮处于 Ajaxify 模式)
感谢您的关注...
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...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
听起来您正在尝试混合 Ajax 化属性和 DOM 元素属性。
当你ajaxify它时,保留属性Enabled =“True”,然后在页面加载时使用JS将其设置为btnSend.disabled = true。如果您使用纯 js 来禁用它,上面的函数应该可以很好地重新启用它。例如,如果 ajaxify 属性“Enabled”设置为 true,则将以下 javascript 放入您的页面中:
然后使用上面编写的函数 onkeyupontextbox() 启用它。因为 javascript 正在禁用该按钮,所以它应该能够重新启用它。之前,您禁用了 Ajaxified 属性并尝试使用 js 重新启用。
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:
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.
以下可以是答案吗? (没有使用 RadAjaxmanager 的经验)
在这里找到:http://www.telerik。 com/help/aspnet-ajax/grdenabledconventions.html
Could following be the answer? (Dont have experiences with RadAjaxmanager)
Found here: http://www.telerik.com/help/aspnet-ajax/grdenabledconventions.html