setting default enter button

  • Thread starter Thread starter andyrich_1
  • Start date Start date
A

andyrich_1

I have a simple form that has two submit buttons on it.
The problem I have is that I want one button to be the default button
when the user is filling out one section of the form and another button
to be the default when filling out a different art of the form.

I can't seem to find a way of stopping the first button on the form
begin selected.

I know there is a way to do this in ASP.NET 2.0 but I can't seem to
find one in ASP.NET 1.0

Thanks,
Andy
 
In ASP.NET 1.x, you can set the default button, but it requires a trip to
the server.

Page.RegisterHiddenField("__EVENTTARGET", "MyButton");

If you are basing decisions on what is going on while the form is being
filled out, you need to use JavaScript. One way is to handle the button
press event and adjust the button pushed based on what button is pushed
(enter, for example). Another is to set the Event Target. I believe this is
document.eventTarget = objToPush;.

--
Gregory A. Beamer

*************************************************
Think Outside the Box!
*************************************************
 
Back
Top