灯火互联
管理员
管理员
  • 注册日期2011-07-27
  • 发帖数41778
  • QQ
  • 火币41290枚
  • 粉丝1086
  • 关注100
  • 终身成就奖
  • 最爱沙发
  • 忠实会员
  • 灌水天才奖
  • 贴图大师奖
  • 原创先锋奖
  • 特殊贡献奖
  • 宣传大使奖
  • 优秀斑竹奖
  • 社区明星
阅读:3558回复:0

jsp中有关于超链接的问题

楼主#
更多 发布于:2012-09-10 19:52

有如下情况:


<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();
}  

喜欢0 评分0
游客

返回顶部