Re: FORM with buttons



On Mon, 27 Oct 2008 19:48:38 -0500, Joe <stuff@xxxxxxxxxxxxxxxxx>
wrote:

I have been scouring html help sites to figure this out, but so far have
not found it. Either it's too easy or maybe it's not possible...

I have a simple form with three buttons in a horizontal row. Actually
it ONLY has buttons, no text fields. How do I specify the SECOND button
to have focus when the form opens, such that if the user simply presses
'Return', the second button's logic is executed? It seems (unless I'm
missing something) that the first button is always defaulting to focus,
and gets executed if user presses 'Return' (if they don't click
anywhere).

Anyone know how to accomplish this? I'm fairly familiar with form HTML
(I'm using '<INPUT..' tag), so it's probably just an option or attribute
I'm not finding.

Thanks!

Have you considered the possibility of giving focus to the "enter" key
itself?

After all, a button is only an option. If you define what happens when
enter is pressed, then who cares what button has focus.

.



Relevant Pages

  • Re: JOptionPane returning Object?
    ... be returned when the user presses the "ok" ... >> JFrame, that returns the object? ... >> the JOptionPane. ...
    (comp.lang.java.help)
  • Re: I want to press Enter in CEdit box and have a function be called
    ... control has the focus when the Enter is pressed. ... I want to be able to call a function when the user presses Enter in any ... when user presses Enter in edit box ...
    (microsoft.public.vc.mfc)
  • KeyPreview doesnt trap Enter key
    ... I need a form to take a certain action when the user presses the Enter key. ... I set KeyPreview to True at design time and never change it. ... Focus is on a control other than a command button, ...
    (microsoft.public.vb.bugs)
  • A few Qs
    ... I want to lock all of the fields and when user presses a ... button it unlocks them for editing. ... as soon as record changes, ...
    (microsoft.public.access.gettingstarted)
  • Re: FORM with buttons
    ... richard wrote: ... I have a simple form with three buttons in a horizontal row. ... to have focus when the form opens, such that if the user simply presses ... and gets executed if user presses 'Return' (if they don't click ...
    (alt.html)