jsp中有關於超鏈接的問題

 有如下情況:

<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="#" οnclick="queryStandard()" 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();
}


 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章