<script type="text/javascript"> function aa() { var actionUrl = registerUser.action'; document.forms[0].action = actionUrl; document.forms[0].submit(); } </script> <s:form action="registerUser" method="post" theme="simple"> <table width="303" border="0" cellspacing="3" cellpadding="0"> <tr> <td colspan="2" class="cont_font"><br/> <input type="image" name="imageField" src="include/img/button5.jpg" οnclick="aa()"/> </td> </tr> </table>
在调代码的时候,action总是调两次,后来才知道,原来image也是个submit.