javascript - jQuery : Want to disable all the input fields if editqastatus value = 1 or 2

标签 javascript php jquery mysql ajax

Jquery:如果输入字段 editqstatus 值 = 1 或 2,想要禁用模式表单中的所有输入字段。

函数editMember(id = null) { 如果(id){

    // remove the error 
    $(".form-group").removeClass('has-error').removeClass('has-success');
    $(".text-danger").remove();
    // empty the message div
    $(".edit-messages").html("");

    // remove the id
    $("#member_id").remove();

    // fetch the member data
    $.ajax({
        url: 'php_action/getSelectedMember.php',
        type: 'post',
        data: {member_id : id},
        dataType: 'json',
        success:function(response) {

        $("#editqastatus").val(response.qastatus);
        $("#editdisqreason").val(response.disqreason);
        $("#editcampaignname").val(response.campaignname);
        $("#editassettitle").val(response.assettitle);


            // here update the member data
            $("#updateMemberForm").unbind('submit').bind('submit', function() {

最佳答案

我不太确定你是否在谈论这个:

   if ($("#editqastatus").val() == 1 || $("#editqastatus").val() == 2) {
        $(".modal").find('input').attr('disabled', 'disabled')
    } else {
        $(".modal").find('input').removeAttr('disabled')
    }

“.modal”替换为将输入包装在模态中的类。

关于javascript - jQuery : Want to disable all the input fields if editqastatus value = 1 or 2,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43815294/

相关文章:

javascript - 不存在的属性 HTML 输入字段

javascript - 如何更改使用功能选择的单选按钮?

php - 使用 constant() 函数和直接通过名称引用常量有什么区别?

javascript - 如何将 SVG 图导出为 pdf

php - Amazon SQS 在 php 中发送消息属性

php - 在 PHP 中使用多个条件对数组进行排序

jquery - 是否可以使用 jquery 动态覆盖 css?

javascript - 如何在提交时将每个输入段落包装到单独的输入字段中?

javascript - 在 CrossRider 的 appAPI.ready() 函数中创建的全局变量不可用于页面?

javascript - Div 下拉菜单的行为类似于选择或组合