经测试,发现form传值中…… file类型使用上传组件。比如SmartUpload. 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 使用上传组件,比如楼上说的jspsmartupload,他有方法来取得你想要得value具体察看api <form method="POST" action="saveFile.jsp" enctype="multipart/form-data" name="fileInfo">你是不是少了enctype属性 可能我开始没有说清楚问题。现府上代码<form method="post" action="/operaterdispacher" enctype="multipart/form-data"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="40%"> <div align="right"><input type="image" src="images/ok01.gif" width="48" height="19" name="operation" value="login"></div> </td> <td width="60%"> <div align="center"><input type="image" src="images/ok02.gif" width="48" height="19" name="operation" value="registe"></div> </table></form>我希望出来的结果是在提交到的页面上显示我按的那个图片的value值,而不是为了上传,sorry 那就要使用脚本了。在image button的onclick事件里改变另一个<input type=hidden>表单的值。 那就要用脚本onclick控制另一个hidden的value了。 可是一个hidden的value只能传一个值,而我有两个input需要区分 <form method="post" action="/operaterdispacher" enctype="multipart/form-data"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="40%"> <div align="right"><input type="image" src="images/ok01.gif" width="48" height="19" name="operation" onclick="document.all['do'].value='login'" value="login"></div> </td> <td width="60%"> <div align="center"><input type="image" src="images/ok02.gif" width="48" height="19" name="operation" onclick="document.all['do'].value='registe'" value="registe"></div> <input type=hidden name=do value=> </table></form>取参数的时候就判断request.getParameter("do")就行了。 成功了,谢谢javahui(阶级斗争要年年讲,月月讲,天天讲。) 如何限制checkbox单选,获取checkbox那行数据 [紧急][在线等]请问一个关于路径错误的问题~ jsp运行时抛出的异常,帮忙分析一下是什么错误 在linux下jsp 那有org.apache.tools.zip下载呀,下载完后需要把这个ZIP包放到什么地方? 怎么实现过滤网页的功能啊? jsp中调用ireport作的报表,出错了!!!?? 一个很简单的问题,可我就是想不通…… 欢迎大家下载我的软件,下载者有分. 关于WAP的问题 关于写日子问题 jsp怎么用JSP:INCLUDE执行asp的语句?我在java的官方网站查了,说可以。
具体察看api
<form method="post" action="/operaterdispacher" enctype="multipart/form-data">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="40%">
<div align="right"><input type="image" src="images/ok01.gif" width="48" height="19" name="operation" value="login"></div>
</td>
<td width="60%">
<div align="center"><input type="image" src="images/ok02.gif" width="48" height="19" name="operation" value="registe"></div> </table>
</form>
我希望出来的结果是在提交到的页面上显示我按的那个图片的value值,而不是为了上传,sorry
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="40%">
<div align="right"><input type="image" src="images/ok01.gif" width="48" height="19" name="operation" onclick="document.all['do'].value='login'" value="login"></div>
</td>
<td width="60%">
<div align="center"><input type="image" src="images/ok02.gif" width="48" height="19" name="operation" onclick="document.all['do'].value='registe'" value="registe"></div>
<input type=hidden name=do value=>
</table>
</form>
取参数的时候就判断request.getParameter("do")就行了。