Hi all,
I have a form with 2 buttons. One of them is of <html:submit> kind, and it calls the form action. I also have another button, a <html:button> one that is supposed to call a secondary action. This action will set some attributes in the page that will be needed by the main action.
So, my question is: how do I call the action from the <html:button>'s onclick event? I tried to use onclick="location.href='My
Action.do'
". But when I do that, I cannot retrieve any data from the form. For example, in the secondary action I tried:
String key = form.getKey();
It always returns null, even if the field was filled.
If I change the <html:button> to <html:submit> and delete the other <html:submit>, and change the form action to the secondary action, it works. So I think the problem is the way I'm calling the secondary action.
Any tips?
Thanks in advance!
Start Free Trial