focus on wrong button

  • Thread starter Frederik Vanderhaegen
  • Start date
F

Frederik Vanderhaegen

Hi,

I've written a sort of wizard in which the user has to answer some
questions.
This wizard contains a radiobuttonlist en two buttons (back and next).
With the first question there's no problem because I only show one button
but with the second question the problems start.
In the beginning no control has the focus but when the user select an option
from the list, the focus is automaticly set on the back button.
So when the user presses the ENTER key, it goes back to the previous
question in stead of to the next.
Is there a way to put the focus on the next button so it goes to the next
question?

Thx in advance.


Frederik
 
E

Eliyahu Goldin

You can do it in a javascript. Setup an onload event for the <body> tag. In
the event handler put a line.

myForm.nextButton.focus();

You can get server side to emit client side code that will tell the client
what button is to set focus on.

Eliyahu
 
F

Frederik Vanderhaegen

Hi,

My focus problem is solved by replacing the back button with a
htmlinputbutton but now I have another problem.
With the <asp:button> I used the command event to pass a variable through
the commandargument, htmlinputbuttons don't have this event.
Is there a workaround or a way to generate the command event?

Frederik
 

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