setting default enter button

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
 
C

Cowboy \(Gregory A. Beamer\)

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!
*************************************************
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top