【问题标题】:How can I get the value that comes true with the checkbox checked in the "update" modal popup?如何获得在“更新”模式弹出窗口中选中复选框的值?
【发布时间】:2021-04-09 14:43:20
【问题描述】:

当我打开要更新的模式时,我会获得所有信息。但是,尽管我的复选框值为 true,但我无法在屏幕上将其显示为选中状态。 documentName 和 documentCode 是文本值,其他是选择选项。

$('#selectedAddDocName').val(data.techDocInfoList[0].technicalDocumentTypeId).trigger('change');
$('#selectedAddTeknikResim').val(data.techDocInfoList[0].technicalDocumentSubTypeId).trigger('change');
$('#selectedStokGrubu').val(data.techDocInfoList[0].technicalDocumentStockGroupId).trigger('change');

document.getElementById('dokumanKoduInputModal').value = data.techDocInfoList[0].documentCode;
document.getElementById('dokumanAdiInputModal').value = data.techDocInfoList[0].documentName;

【问题讨论】:

  • 设置 checkbox.checked
  • 此问题与c#无关
  • 我试过但没用。你会建议我具体写在哪里?

标签: javascript jquery checkbox bootstrap-modal


【解决方案1】:

我解决了。

 if (data.techDocInfoList[0].isSecret == true) {
 document.getElementById("checkSecretModal").checked = true;
    }
 else {
   document.getElementById("checkSecretModal").checked = false;
   }

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-09-12
    • 1970-01-01
    • 2011-04-16
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多