在jquery AJAX调用之后,我无法启用文本输入。 [英] After jquery AJAX call, I can't enable a text input.

查看:71
本文介绍了在jquery AJAX调用之后,我无法启用文本输入。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

ASP.Net应用程序使用JQuery AJAX。在AJAX调用之前,我可以在文本框中更新输入,但在AJAX调用之后它似乎完全禁用,不允许在文本框中编辑,但其他控件(CheckBox,按钮,日期选择器)仍然启用。

注意最后在.complete中,我添加了一行试图强制它启用,但没有帮助:

$('#idtxtLoggingDaysDisplayed')。prop('disabled',false);

任何建议都将非常感激。谢谢,迈克





ASP.Net app uses JQuery AJAX. Before the AJAX call I can update the input in a text box, but after the AJAX call it seems completely disabled allowing no editing in text box, but other controls (CheckBox, Buttons, datepicker) are still enabled.
Notice at the end in .complete, I added a line to try to force it enabled, no help though:
$('#idtxtLoggingDaysDisplayed').prop('disabled', false);
Any suggestions would be very appreciated. Thanks, Mike


$.ajax({
    type: "POST",
    url: "GC_UserErrors.aspx/receiveAJAXMessage",
    data: sMsg1,
    beforeSend: function () {
        $(document).keydown(function () { return false; }); // disable keyboard input
        $(".overlay").show(); // show loader
        $('#loadingGIF').show();
    },
    contentType: "application/json; charset=utf-8",
    dataType: "json",
    complete: function () {
        $(document).keydown(function () { return true; }); // enable keyboard
        $(".overlay").hide(); //hide loader
        $('#loadingGIF').hide();
        $('#idtxtLoggingDaysDisplayed').prop('disabled', false);
    },
    success: OnSuccess,
    failure: //function (response) {
        OnFailure
});





我尝试过:



也尝试了



What I have tried:

Also tried

$('#idtxtLoggingDaysDisplayed').attr('disabled', false);

推荐答案

('#idtxtLoggingDaysDisplayed')。prop('disabled', false);

任何建议都会非常感激。谢谢,迈克





('#idtxtLoggingDaysDisplayed').prop('disabled', false);
Any suggestions would be very appreciated. Thanks, Mike



.ajax({
类型:POST,
url:GC_UserErrors.aspx / receiveAJAXMessage,
数据:sMsg1,
beforeSend:function(){
.ajax({ type: "POST", url: "GC_UserErrors.aspx/receiveAJAXMessage", data: sMsg1, beforeSend: function () {


(document).keydown(function(){return false;}); //禁用键盘输入
(document).keydown(function () { return false; }); // disable keyboard input


这篇关于在jquery AJAX调用之后,我无法启用文本输入。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆