【问题标题】:Disable and enable note field depends on note field value null or not禁用和启用注释字段取决于注释字段值是否为空
【发布时间】:2021-02-08 11:46:49
【问题描述】:
 $(document).on('click', '.update', function() {
var user_id = $(this).attr("id");
$.ajax({
    url: "fetch_single.php",
    method: "POST",
    data: {
        user_id: user_id
    },
    dataType: "json",
    success: function(data) {
        $('#userModal').modal('show');
        $('#name').val(data.name);
        $('#status_id').val(data.status_id);
        $('#note').val(data.note);
        $('#note_tow').val(data.note_tow);
        $('#note2').val(data.note2);
        $('#note3').val(data.note3);
        $('#payment').val(data.payment);
        $('#ntg_no').val(data.ntg_no);
        $('.modal-title').text("تعديل الحالة");
        $('#user_id').val(user_id);
        $('#action').val("Edit");
        $('#operation').val("Edit");
            if ($("#note").val() !== '') {
        $("#note").prop("disabled", true);
          } else {
       $("#note").prop("disabled", false);
    }
    }
});
});

我想禁用和启用注释字段取决于注释字段值 null 或不为 null 当我在更新任何字段时将字段注释清除时提出问题。

【问题讨论】:

    标签: javascript php jquery updates disabled-input


    【解决方案1】:

    问题已解决,将禁用替换为只读

    【讨论】:

      猜你喜欢
      • 2020-11-03
      • 2023-04-03
      • 2018-04-25
      • 2020-03-28
      • 1970-01-01
      • 2017-12-18
      • 2019-04-30
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多