<logic:present name="aq2016Entity" property="aq2017Entitys">
             <logic:iterate id="aq2017Entity" name="aq2016Entity" property="aq2017Entitys" indexId="indexId">
              <bean:define id="aq2018Flag" name="aq2017Entity" property="aq2018Flag" type="String"/>
              <table width="100%" class="result"  border="1" align="center" cellpadding="0" cellspacing="0" vspace="0">
               <tr>
                 <td width="20%" align="center" bgcolor="eeeeee"><font color="#333333">根原因名称:</font></td>
                 <td width="80%" height="25" align="left" id="aq2017Entity_gyyid" >
                  <strong><font color="#004499"><bean:write name="aq2017Entity" property="reasonName" filter="false"/></font></strong>
                 </td>
              </tr>
              <% if(aq2018Flag!=null&&aq2018Flag.equals("false")){%>
              <tr>
                 <td align="center" bgcolor="eeeeee"><font color="#333333">事实与分析:</font></td>
                 <td height="25" align="left" class="wrap"><bean:write name="aq2017Entity" property="reason_desc" filter="false"/></td>
              </tr>
              <%}else{%>
              <tr>
                 <td align="center" bgcolor="eeeeee"><font color="#333333">事实与分析:</font></td>
                 <td height="25" align="left" class="wrap"><bean:write name="aq2017Entity" property="reasonOptions" filter="false"/></td>
              </tr>
              <%}%>
              <tr>
                 <td height="5" align="center" bgcolor="#FFFFFF" colspan="2"></td>
              </tr>
              <tr>
              <td colspan="2"></td>
              </tr>
              </table>
              </logic:iterate>
            </logic:present>==================================================
function addEventInvestigate() {
    //alert(document.forms[0].scene_id.value) ;
var str =document.forms[0].sceneId.value;
var str1=document.getElementById("scene_id_wxysbid").innerText;
// var str3=document.getElementById("aq2017Entity_gyyid").value;
//          var str3=document.getElementById("aq2017Entity_gyyid").innerText;
document.forms[0].operate.value="toAddEventResult";
document.forms[0].submit();
}怎么在这里取出 根原因名称 的值 也就是bean:write name="aq2017Entity" property="reasonName" filter="false"/></font>里的值

解决方案 »

  1.   

    都有什么方法可以取出来呢,总是报 aq2017Entity_gyyid 缺少对象 错误,这是在<fieldset>里的,应该没有什么关系吧
      

  2.   

    哎~~看着这种jsp和js嵌套的代码就囧得荒 查看一下源文件
    另外:innerText 是IE Only的
      

  3.   


    aq2017Entity_gyyid这个id你从哪儿得到的??
      

  4.   

    我试过了,用这个可以取到他的值----document .getElementById ("aq2017Entity_gyyid").innerHTML;
        得到的值为:    <STRONG><FONT color=#004499><BEAN:WRITE property="reasonName" name="aq2017Entity" filter="false" /></FONT></STRONG>
      

  5.   

    现在的情况是这样的:有个新建场景,点击新建场景 里面有跟原因名称等信息,现在要点击下一步(进入下一个页面)但是我这个跟原因的名称是必填项,就是想做个判断,不添加跟原因名称 就不能进入下一步。我要是不点击新建场景按钮,这个页面是没有跟原因这个信息的,但是跟原因这段代码还在本页面上在<fieldset>...</fieldset>里面,也就是说我 取值的时候 新建场景里的跟原因名称等信息还没有创建出来呢,所以会报,对象不存在,那么现在我要怎么判断呢
      

  6.   

    可能问题描述的不是很清晰,现在已经解决了,直接用var str=document .getElementById ("aq2017Entity_gyyid")对str对象进行的判断,if(str=="" || str==null){return false}