Trapping enter key with an ASP.Net 2.0 Wizard control to move to next step

C

csriram

I have 2 panels on the same form (PanelNew and PanelUpdate),

1) Only one of them is visible at any time based on the operation
(add/update)
2) PanelNew has a wizard control with 4 steps named
WizardTripTikOrderEntry
3) PanelUpdate has a radio button list for search criteria and a find
button that uses the text typed in a search text box to retrieve
records based on criteria chosen in radio button list
4) If PanelNew is visible, WizardTripTikOrderEntry is visible; if
PanelUpdate is visible btnFind is visible - those are the two controls
I want to trap the enter key for

I trapped the enter key for the find button just fine using the
following client side javascript. But when I did the same for the
Wizard control, it did not work.


<body onkeydown="return catchEnter();">

</script>

<script type="text/javascript" >
function catchEnter()
{

if (event.keyCode == 13)
{

__doPostBack('<%=WizardTripTikOrderEntry.ClientID%>',"");
__doPostBack('<%=btnFind.ClientID%>',"");

return false;
}
else
{
return true;
}
}
</script>

How can I

1) Get the enter key trapped correctly for the wizard control and
initiate the move to the next step? Can I use an invisible button
inside a StepNavigationTemplate or is there any other way? I have so
many controls (about 40 of them) already coded in the NextButtonClick
and ActiveStepChanged events that I do not want to re-do the entire 4
steps with templated controls.
2) Have the enter key trapping occur only when the server side control
is visible (either button or wizard control but not both)?

PLEASE HELP.

Chad
 

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

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top