2013-05-20 32 views
0

我有一个HTML形式的多个按钮,但我需要在struts仅执行单一按钮动作等按钮不要去execute()方法1.3如何执行单一的Struts表单提交行动

如:

button1: connect 
button2 : disconnect 
button3 :save 

我只需要执行保存按钮操作会去支柱execute()方法别人也不会去

在此先感谢

回答

1

让Button1的和BUTTON2简单的按钮,使BUTTON3作为提交按钮

<button type="button" onclick="connect()">Button1</button> 
<button type="button" onclick="disconnect()">Button2</button> 

<input type="submit" value="button3"> 
1

nd因此点击这些按钮不要提交表单到服务器,直到你写入onclick()事件,但第三个是通过点击提交请求提交按钮发送到服务器automayically到在行动中给出的资源属性在标签中。

<input type="button" value="connect"/> 
<input type="button" value="disconnect"/> 
<input type="submit" value="save"/> 
相关问题