Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

button focus problem with multiple <html:submit> buttons

 
Mohit Jain
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ranchers

I have a JSP having two textbox with "Cancel" and "Submit" buttons. Both buttons are <html:submit> type.

After typing in textbox if we press <Enter> key, the Cancel button is executed. This is because the cancel button is the first button on page and is by default focussed on pressing <Enter> key.

I want the second button ("Submit") to be focussed by default.

My Code is something like -

<html:password property="newPassword"/>
<html:password property="reenterPassword"/>

<html:submit property="bipSubmit" value="Cancel"/>
<html:submit property="bipSubmit" value="Submit"/>

Please suggest how to implement this, I prefer not to use JAVASCRIPT.

Its urgent.
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!