比如
<form method="post" action="hello.jsp" name="form1">
<input type="text"/>
<input type="submit" name="submit1" value="增加"/>
<input type="submit" name="submit2" value="删除"/>
</form>我是想获取按钮的值(在一个form中),做出不同的判断......
<form method="post" action="hello.jsp" name="form1">
<input type="text"/>
<input type="submit" name="submit1" value="增加"/>
<input type="submit" name="submit2" value="删除"/>
</form>我是想获取按钮的值(在一个form中),做出不同的判断......
<input type="text"/>
<input type="button" name="submit1" value="增加" onclick="add()"/>
<input type="button" name="submit2" value="删除" onclick="del()"/>
</form>
String del=(String)request.getParameter("submit2");
String action=null;
if(add!=null){
action=add;
else
action=del;
}
if(action.equals("增加")){
// to do add events;
}
elseif(action.equals("删除")){
//to do delete events;
}
else{
throw new Exception();
}
<input type="button" name="s" value="接分"/>
</form>提交到另一网页
A=Request("s")
if A="接分" then
..........................取到按扭的值后做你想做
..........................