m0_68177780 2022-11-04 14:49 采纳率: 54.5%
浏览 28
已结题

无法设置未定义或 null 引用的属性“value” ,如何解决?

SCRIPT5007: 无法设置未定义或 null 引用的属性“value”
mainFrameForm.gsClientCorporateDtoBussinessSource.value = bussinessSourceArray['codeCode']有什么错误请问

  var bussinessSourceArray = new Array();
        bussinessSourceArray['codeCode']=QueryResultFrame.document.getElementsByName("codeCode")[clientIndex].value;
      bussinessSourceArray['codeCName']=QueryResultFrame.document.getElementsByName("codeCName")[clientIndex].value;
        
        if(evaluateMainFrameAgreement(bussinessSourceArray, window.parent.opener.fm)){    
      }else{
          window.parent.close();
      }
   }
   function evaluateMainFrameAgreement(bussinessSourceArray,mainFrameForm){
      if(bussinessSourceArray != null) {
        var type=document.getElementsByName("type")[0].value;
        alert(type);
        if(type==1){
             mainFrameForm.gsClientCorporateDtoBussinessSource.value = bussinessSourceArray['codeCode'];
             alert(mainFrameForm.gsClientCorporateDtoBussinessSource.value)
             mainFrameForm.gsClientCorporateDtoBussinessSource.onchange();    
        }
      }


```html
<html:form action="/sales/corporateQuery.do?actionTyp=bussinessSourceNameResult" target="QueryResultFrame">
<input type="hidden" name="type"  value="<%=request.getAttribute("type")%>">

<table id="BeforeOverViewMain" class="common" cellpadding="2" cellspacing="1"> 
    <tr><td class="formtitle" colspan="4"><bean:message key="prompt.queryBussinessSource"/></td></tr> 
    <tr>
    <td class="left"><bean:message key="GsClientCorporateDto.bussinessSource"/></td>
    <td class="right">
        <input name="bussinessSource" class="common" type="text" maxlength="18">
      </td>
    <td class="left"><bean:message key="GsClientCorporateDto.bussinessSourceName"/></td>
    <td class="right">
      <input name="bussinessSourceName" class="common" type="text">
    </td>
  </tr>
  
 </table>
<table id="buttontable" class="button" cellpadding="5" cellspacing="1">
  <tr align="center">
    <td align="center">
    
      <input type="button" class="button" value="<bean:message key="</span><span class="hljs-attr">button.find" />" onClick="queryMethod()" >
    </td>
    <TD align="center">
    
        <input type="button"  class="button" value="<bean:message key="</span><span class="hljs-attr">GuItemKindLoadingDto.selectedInd" />" onClick="selectBussinessSource();" />  
     </TD>
  </tr>
</table>
<table class="button" cellpadding="5" cellspacing="1">
   <tr>
     <td ><iframe name="QueryResultFrame" src='about:blank' style='Z-INDEX:1;WIDTH:100%;HEIGHT:410'
        marginwidth='0' marginheight='0' hspace='0' vspace='0' frameborder='0' scrolling='no'> </iframe></td>
   </tr>
</table>  
<jsp:include page="/common/StaticJavascript.jsp" />
</html:form>
</body>
</html>


```

  • 写回答

2条回答 默认 最新

  • 心寒丶 全栈领域优质创作者 2022-11-04 14:54
    关注

    这个元素为空或者找不到这个元素吧

    img

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

问题事件

  • 系统已结题 11月15日
  • 已采纳回答 11月7日
  • 创建了问题 11月4日

悬赏问题

  • ¥15 微信会员卡等级和折扣规则
  • ¥15 微信公众平台自制会员卡可以通过收款码收款码收款进行自动积分吗
  • ¥15 随身WiFi网络灯亮但是没有网络,如何解决?
  • ¥15 gdf格式的脑电数据如何处理matlab
  • ¥20 重新写的代码替换了之后运行hbuliderx就这样了
  • ¥100 监控抖音用户作品更新可以微信公众号提醒
  • ¥15 UE5 如何可以不渲染HDRIBackdrop背景
  • ¥70 2048小游戏毕设项目
  • ¥20 mysql架构,按照姓名分表
  • ¥15 MATLAB实现区间[a,b]上的Gauss-Legendre积分