My form is :
<script type="text/javascript">
method1(){form.action='first'}
method2(){form.action='second'}</script>
<form if="formID">
<s:submit onclick="method1();" name="upload"/>
<s:textfield name="search" />
<s:submit onclick="method2()"/>
When i press enter key form is submitting with action ‘first’ . The control is directly going to method1 and submitting. When i press enter key i want control has to go to method2 and form should submit with action ‘second’.
How do i can do it?
You can detect which key has been hit.
Or you can use 2 forms, with 2 different submit buttons. But I guess you have more fields that in your code snippet.