Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to default to one of submit buttons when enter is pressed

Status
Not open for further replies.

sandeepagarwals

Programmer
Joined
Mar 14, 2006
Messages
4
Location
AU
I have a HTML in which there are couple of textfields and multiple submit buttons. The problem is that i want to default to second submit button whenever a enter key is pressed in the textfield. As of now it always defaults to first submit button only.

Is there a way to get over this keeping all the buttons as submit button or what is the clean way of doing this?

Thanks,
Sandeep
 
I tried this but still does not work with tabindex too.
 
i cannot do that since the application demands them to be in the same order.
 
consider making all of your submit buttons regular buttons that call a javascript function which would submit the form. the one you want to be the default, make it a submit input, rather than a regular button input.



*cLFlaVA
----------------------------
[tt]( <P> <B>)13 * (<P> <.</B>)[/tt]

[URL unfurl="true"]http://www.coryarthus.com/[/url]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top