【问题标题】:How to change checkbox's label text in javascript in iframe如何在iframe中的javascript中更改复选框的标签文本
【发布时间】:2013-12-14 01:16:37
【问题描述】:

我在脚本管理器和更新面板中有复选框。

单击 aspxDevGridView 中的任何行后,我希望在 javascript 中更改复选框 LABEL 文本。

我正在从 aspxGridViews 客户端事件中调用 javascript。 aspx 页面在 iframe 中,我无法更改复选框的文本。

function OnGridSelect(fldval) {
      document.getElementById("HF_Code").value = fldval[0];
      //I added one label beside checkbox to display the value and it worked
      //but unable to change the text of CB_Asset with innerHTML 
      //Tried clientID as well which does not work.
      document.getElementById('Lbl_Asset').innerHTML = fldval[2] + " Included";
      document.getElementById("CB_Asset").checked = (fldval[1] == "1");
      document.getElementById("RBL_Cost").value = fldval[2];
  }

提前谢谢你

【问题讨论】:

    标签: javascript asp.net checkbox


    【解决方案1】:

    尝试这样的方法来获取 iframe 的内部 html:

    var iframe = document.getElementById('iframeId');
    var innerDoc = iframe.contentDocument || iframe.contentWindow.document;
    

    【讨论】:

      猜你喜欢
      • 2017-09-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-06-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多