Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Struts and the fly likes major problem with html:cancel and html:submit Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "major problem with html:cancel and html:submit" Watch "major problem with html:cancel and html:submit" New topic
Author

major problem with html:cancel and html:submit

Rauhl Roy
Ranch Hand

Joined: Aug 01, 2006
Posts: 401

if I have to show the user in the below order and want to always focus on Submit button it is not possible.

requirement: I have to display the buttons like below order only and there is no change in the clinet-requrement to show the buttons in other way.
And when I click the Enter key the form should be submitted.
[here is mouse moves moves and clicks should ne used]

By displaying the buttons like this html:cancel button gets the focus so the when you click on enter button automatically it cancels your action.

And i dont want like this please let me know if ther is any solution to this problem. And, i dont want to chat html:cancel to Html:button also.

rahul.
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
You might try providing a tabindex attribute for each of your inputs and making sure that the tab index for the submit button is lower than that of the cancel button. That way, when the user exits the last input field, the focus will go to the submit button instead of the cancel button.


Merrill
Consultant, Sima Solutions
Rauhl Roy
Ranch Hand

Joined: Aug 01, 2006
Posts: 401

Originally posted by Merrill Higginson:
You might try providing a tabindex attribute for each of your inputs and making sure that the tab index for the submit button is lower than that of the cancel button. That way, when the user exits the last input field, the focus will go to the submit button instead of the cancel button.


purpose of the tabindex seems to be deffrent. and this is not a solution to my senario. By default it focuses on the first submit button[in my case it is Cancel button ]. it works fine when you navigate through tab button and when you start typying something the focues gets changed to the the first submit button, which is of course the Cancel in my case.

Same problem with html:form's focus attribute also...

please let me know if there is any simple solution to this problem.

rahul
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: major problem with html:cancel and html:submit