jsp中有关于超链接的问题
4308 点击·0 回帖
![]() | ![]() | |
![]() | 有如下情况: <form id="detailForm" name="detailForm" action="${ctxPath}/freeEvaluation.do?cmd=queryfreeEvaluation" method="post" enctype="multipart/form-data"> <input id="account" name="account" type="hidden" value="${account_id}"/> <input id="mgrOrgId" name="mgrOrgId" type="hidden" value="${freeEvalAccount.fk_manager_organization_id}"/> <table cellpadding="0" cellspacing="0" width="100%"> <tr> <td colspan="6" align="right"> <a href="${ctxPath}/freeEvaluation.do?cmd=freeEvalAccountStandard" style="text-decoration: underline"><font size="3" color="#5500FF"><b>免评客户标准</b></font></a> </td> </tr> </table> </form> 提交之后,发现取不到两个隐藏域的内容。 原因很简单,作用域不同,所以在超链接是无法访问那两个隐藏域的。 修改成: <a href="${ctxPath}/freeEvaluation.do?cmd=freeEvalAccountStandard;account=${account_id};mgrOrgId=${freeEvalAccount.fk_manager_organization_id}" style="text-decoration: underline"><font size="3" color="#5500FF"><b>免评客户标准</b></font></a> 就可以了。 或者可以这样解决: <a href="#" style="text-decoration: underline;"><font size="3" color="#5500FF"><b>免评客户标准</b></font></a> 然后在js函数里面去实现 function queryStandard(){ window.top.changeTitle("免评客户标准"); document.detailForm.target = "_self"; document.detailForm.cmd.value = "freeEvalAccountStandard"; document.detailForm.submit(); } | |
![]() | ![]() |