<form method="post" action="2.jsp">
<table width="738" height="40" border="0" align="center" cellpadding="0" cellspacing="0" >
<tr>
<td width="340" height="40" align="left">Book Critique</td>
<td width="235" align="left">up to 100,000 words</td>
<td width="157" align="left">Within 2 weeks
<input type="radio" name="type" value="3" />
</td>
</tr>
<tr>
<td height="40" align="left">Book Critique</td>
<td align="left">from 100,000 up to 250,000 words </td>
<td align="left">Within 3 weeks
<input type="radio" name="type" value="2" />
</td>
</tr>
<tr>
<td height="40" align="left">Book Critique</td>
<td align="left">from 250,000 words </td>
<td align="left">Within 4 weeks
<input type="radio" name="type" value="1" />
</td>
</tr>
</table>
<input type="submit" name="Submit" value="提交" />
</form>
这里有一段选择类型的代码,我想比如我选择的是type.value="1"的选项,之后把值传到2.jsp,在2.jsp页面上既拿到value的值,也拿到Book Critique 和 from 250,000 words within 4 week这几个值
应该怎样呢,我是新手,请详细给我说说,谢谢。
解决方案 »
- spring下mybatis多数据源配置问题
- ibatis多连接后返回的resultMap对象可以不映射数据表不???
- struts2的action采用redirect重定向时不允许输入多个参数?
- 祝大家元旦快乐
- 关于iframe(IE6有问题)
- 什么错误“The content of element type "bean" must match ”
- 小菜问题!!!
- 路过的请进来帮个忙!关于主页面用include包含子文件出现的中文显示问题
- 关于查询数据库的问题...~~~在线等呀~~~:)
- 增加、修改、删除的jsp页都提交到一个Action处理吗?大家怎么做?
- 如何在ssh中实现分页功能
- hashmap
<td width="235" align="left">up to 100,000 words</td>
<td width="157" align="left">Within 2 weeks
<input type="radio" name="type" value="3" />
的值,然后通过js把这些值连接在一起传到下个页面
|
<td align="left" name="a">Within 4 weeksvar aa=document.getElementbyName("a");
request.setParameter(aa);
我不负责任的
public static final String RADIO_VALUE_1 = "up to 100,000 words Within 2 weeks";
(或保存到properties文件中)然后当选1的时候,第二个画面进行判断,取得Constant.RADIO_VALUE_1。
是写在页面上的吗?
<tr>
<td height="40" align="left"><span id="name3"> Book Critique</span></td>
<td align="left" id="from3">from 250,000 words </td>
<td align="left" id="time1">Within 4 weeks
<input type="radio" name="type" value="3" onclick="getValues(this);"/>
</td>
</tr><tr>
<td height="40" align="left"><span id="name2"> Book Critique</span></td>
<td align="left" id="from2">from 250,000 words </td>
<td align="left" id="time2">Within 4 weeks
<input type="radio" name="type" value="2" onclick="getValues(this);"/>
</td>
</tr><tr>
<td height="40" align="left"><span id="name1"> Book Critique</span></td>
<td align="left" id="from1">from 250,000 words </td>
<td align="left" id="time1">Within 4 weeks
<input type="radio" name="type" value="1" onclick="getValues(this);"/>
</td>
</tr>
-----------------------------------------
function getValues(rad){
var selectedIndex = rad.value;
var name = document.getElementById("name"+selectedIndex).innerHTML;
var from = document.getElementById("from"+selectedIndex).innerHTML;
var time = document.getElementById("time"+selectedIndex).innerHTML;
location.href("2.jsp?name="+name+"&from="+from+"&time="+time);
}
<table width="738" height="40" border="0" align="center" cellpadding="0" cellspacing="0" >
<tr>
<td width="340" height="40" align="left">Book Critique</td>
<td width="235" align="left">up to 100,000 words</td>
<td width="157" align="left">Within 2 weeks
<input type="radio" name="type" value="3" />
</td>
</tr>
<tr>
<td height="40" align="left">Book Critique</td>
<td align="left">from 100,000 up to 250,000 words </td>
<td align="left">Within 3 weeks
<input type="radio" name="type" value="2" />
</td>
</tr>
<tr>
<td height="40" align="left">Book Critique</td>
<td align="left">from 250,000 words </td>
<td align="left">Within 4 weeks
<input type="radio" name="type" value="1" />
</td>
</tr>
</table>
<!--以下是我删除的代码-->
<input type="submit" name="Submit" value="提交" />
<!--以上是我删除的代码-->
<!--以下是我加的代码-->
<anchor>
<go href="2.jsp" accept-charset="GB2312"
method="post"><postfield name="One" value$(type:e)"/>
<postfield name="Two" value="Book Critique"/>
<postfield name="Three" value="from 250,000 words within 4 week"/>
</go>
</anchor>
<!--以上是我加的代码--></form>
写在Constant.java里,然后在页面有<%= %>使用。正规的软件开发一般都是类似的。