Hello
I have following prob:
a form with three buttons
a submit (normal html-button)
a cancel (struts html:cancel button)
and a reset (struts html:reset button)
since I need javascript to run before submition
and after the result of the javascript function deciding if submiting or not I used a submit html-button (I cannot stop the struts html:submit button from submitting even if a put a javascript onClick after the javascript function comes the submition (is there a way to stop it?)).
For the other two buttons the struts html tags.
Now if the user press enter (regardless where the focus is in the form) the cancel action is being activated (the form cancelled)
if I use javascript to put the focus on submit, as soon as the user click on a text field (or any other form component) the "button group focus" moves to the cancel button!
(regardless where was the focus is in the form)
How can I get the "enter key focus" staying on submit?
I already tried the struts <html:form ... focus="submitButton"> and it works at page-load-time BUT as soon as the user click on a text field (or any other form component) the "button group focus" moves to the cancel button ! ! !
Is there a kind of "enter key" focus? Thanks!