晕了,怎样才能把值传给ACTION呢 在线求救呀~~~~~
一个JSP页面,有3个TAB,每个TAB有不同的内容。可这个页面是早就设计好的,编写代码才发现3个TAB下的内容是写了3个层(DIV)控制的,不在FROM中,我怎样才能在ACTION中得到页面上的值呢?
以下是页面的代码?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN " "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<html xmlns= "http://www.w3.org/1999/xhtml ">
<%@ taglib uri= "/WEB-INF/struts-html.tld " prefix= "html " %>
<%@ taglib uri= "/WEB-INF/struts-bean.tld " prefix= "bean " %>
<%@ taglib uri= "/WEB-INF/struts-tiles.tld " prefix= "tiles " %>
<%@ taglib uri= "/WEB-INF/struts-template.tld " prefix= "template " %>
<%@ taglib uri= "/WEB-INF/struts-nested.tld " prefix= "nested " %>
<%@ taglib uri= "/WEB-INF/struts-logic.tld " prefix= "logic " %>
<head>
<meta http-equiv= "Content-Type " content= "text/html; charset=shift_jis " />
<title> aa </title>
<link href= "theme/Master.css " rel= "stylesheet " type= "text/css " />
<script language= "javascript ">
var downloadID = 0;
function changeType ( obj ) {
downloadID = obj.cellIndex;
if ( obj.className != "typeOn " )
selectType ( obj.cellIndex ) ;
}
function mouseOn () {
this.className= 'typeOver ';
}
function mouseOut (){
this.className= 'typeOff ';
}
function selectType ( index ) {
var tb = document.getElementById ( "bodyDiv ").firstChild ;
var row = tb.rows[0];
inTable = document.getElementById ( "tableArea " ) ;
for ( var i = 0 ; i < row.cells.length - 1 ; i ++ ) {
if ( row.cells[i].cellIndex == index ){
row.cells[i].className = "typeOn ";
row.cells[i].onmouseover= "this.className= ' '; ";
row.cells[i].onmouseout= "this.className= ' ' "
inTable.innerHTML = document.getElementById ( "type "+i ).innerHTML ;
}else{
row.cells[i].className = "typeOff ";
row.cells[i].onmouseover=mouseOn;
row.cells[i].onmouseout=mouseOut;
}
}
}
function excelDownload(){
form = document.getElementById( 'DownloadForm ');
form.tabID.value=downloadID;
form.action = " <%=request.getContextPath() %> /excelDownload.do?download=EXCEL ";
form.submit();
}
</script>
<style type=text/css>
.typeOn{
border-top:#6677ee solid 1px ;
border-left:#6677ee solid 1px ;
border-right:#6677ee solid 1px ;
background-color:#e6e6ff;
cursor:hand;
}
.typeOff{
border-bottom:#6677ee solid 1px ;
cursor:hand;
}
.typeOff2{
border-bottom:#6677ee solid 1px ;
}
.typeOver{
background-color:#EEEFFF;
cursor:hand;
border-bottom:#6677ee solid 1px ;
}
.ldrColor{
border-left:#6677ee solid 1px ;
border-right:#6677ee solid 1px ;
border-bottom:#6677ee solid 1px ;
background-color:#e6e6ff;
}
.lColor{
border-left:#6677ee solid 1px ;
}
.lrColor{
border-left:#6677ee solid 1px ;
border-right:#6677ee solid 1px ;
}
.rColor{
border-right:#6677ee solid 1px ;
}
#innerTDDiv{
width:550px;
}
#btnTDDiv{
margin-left:100px;
}
</style>
</head>
<body onload= "selectType(0); ">
<div id= "mainWidth ">
<div align= "left "> qqqqqqq </div>
<form id= "DownloadForm " method= "post " >
<div id= "bodyDiv ">
<table width= "100% " border= "0 " cellpadding= "1 " cellspacing= "0 ">
<tr align= "center ">
<td width= "10% " height= "20 " class= "typeOn " onclick= "changeType(this); " id= "initDiv " nowrap= "nowrap "> a </td>
<td width= "10% " class= "typeOff "
onmouseover= "this.className= 'typeOver '; "
onmouseout= "this.className= 'typeOff ' "
onclick= "changeType(this); " nowrap= "nowrap "> b </td>
<td width= "10% " class= "typeOff "
onmouseover= "this.className= 'typeOver '; "
onmouseout= "this.className= 'typeOff ' "
onclick= "changeType(this); " nowrap= "nowrap "> c </td>
<td width= "70% " class= "typeOff2 "> </td>
</tr>
<tr bgcolor= "#e6e6ff " style= "font-size:1px; ">
<td class= "lColor "> </td>
<td> </td>
<td> </td>
<td class= "rColor "> </td>
</tr>
<tr bgcolor= "#e6e6ff ">
<td colspan= "4 " class= "lrColor " id= "tableArea "> </td>
</tr>
<tr bgcolor= "#e6e6ff " class= "lrColor ">
<td colspan= "4 " class= "lrColor ">
<div id= "btnTDDiv ">
<table border= "0 " cellpadding= "1 " cellspacing= "0 ">
<tr>
<td colspan= "2 "> </td>
<td colspan= "2 "> </td>
</tr>
<tr>
<td colspan= "2 " align= "right "> <html:submit onclick= "excelDownload() " > <bean:message key= "EXCEL "/> </html:submit> </td>
<td colspan= "2 "> <input type= "reset " name= "Submit22 " value= " <bean:message key= "RESET "/> " /> </td>
</tr>
</table>
</div> </td>
</tr>
<tr>
<td colspan= "5 " class= "ldrColor " style= "font-size:1px; " height= "5 "> </td>
</tr>
</table>
</div>
<input type=hidden name=tabID />
</form>
<div id= "hiddenDiv " style= "display:none; ">
<div id= "type0 ">
<div id= "innerTDDiv ">
<table width= "450 " border= "0 " align= "center " cellpadding= "1 " cellspacing= "0 ">
<tr>
<td width= "65 "> </td>
<td width= "381 "> </td>
</tr>
<tr>
<td height= "25 "> EmployeeNo </td>
<td> <input type= "text " name= "EmployeeNo " size= "22 " maxlength= "12 "/> </td>
</tr>
<tr>
<td height= "25 "> time </td>
<td> <input type= "text " name= "From2 " size= "10 " maxlength= "8 "/>
~
<input type= "text " name= "To2 " size= "10 " maxlength= "8 "/> </td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
</table>
</div>
</div>
<div id= "type1 ">
<div id= "innerTDDiv ">
<table width= "450 " border= "0 " align= "center " cellpadding= "1 " cellspacing= "0 ">
<tr>
<td width= "65 "> </td>
<td width= "381 "> </td>
</tr>
<tr>
<td height= "25 "> EmployeeKbn </td>
<td> <select name= "EmployeeKbn ">
<option> all </option>
<option> BP </option>
<option> employee </option>
</select> </td>
</tr>
<tr>
<td height= "25 "> dep </td>
<td> <select name= "sectionFlag ">
<option> all </option>
<option> 1G </option>
<option> 2G </option>
<option> 3G </option>
<option> 4G </option>
</select> </td>
</tr>
<tr>
<td height= "25 "> time </td>
<td> <input type= "text " name= "From22 " size= "10 " maxlength= "8 "/>
~
<input type= "text " name= "To22 " size= "10 " maxlength= "8 "/> </td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
</table>
</div>
</div>
<div id= "type2 ">
<div id= "innerTDDiv ">
<table width= "450 " border= "0 " align= "center " cellpadding= "1 " cellspacing= "0 ">
<tr>
<td width= "100 "> </td>
<td width= "381 "> </td>
</tr>
<tr>
<td height= "25 "> dep </td>
<td>
<select name= "sectionFlag ">
<option> all </option>
<option> 1G </option>
<option> 2G </option>
<option> 3G </option>
<option> 4G </option>
</select>
</td>
</tr>
<tr>
<td height= "25 "> projectKbn </td>
<td>
<select id= "projectKbn " name= "projectFlag ">
<option> </option>
<option> weihu </option>
<option> kaifa </option>
</select>
</td>
</tr>
<tr>
<td height= "25 "> time </td>
<td>
<input type= "text " name= "From222 " size= "10 " maxlength= "8 "/>
~
<input type= "text " name= "To222 " size= "10 " maxlength= "8 "/>
</td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
</table>
</div>
</div>
</div>
</div>
</body>
</html>
[解决办法]
<form> 和 <html:form> 基本是差不多的,都可以被actionForm封装的,只不过 <form> 也是可以不封装的,而 <html:form> 必须有个与之对应的actionForm来封装数据.