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

Discussion in 'ASP .Net Web Controls' started by csriram@leafsoftwaresolutions.com, Dec 26, 2006.

  1. Guest

    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
    , Dec 26, 2006
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Andrzej J. Turowicz
    Replies:
    1
    Views:
    580
    =?Utf-8?B?RFdT?=
    Jan 29, 2006
  2. David Lozzi

    Stop Wizard from progressing to next step.

    David Lozzi, Oct 9, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    1,590
    holsher
    Jan 20, 2011
  3. M. Ali Qureshi

    Changing Next button text for wizard step.

    M. Ali Qureshi, Jan 3, 2008, in forum: ASP .Net
    Replies:
    3
    Views:
    523
  4. BrianDH

    Enter Key H*ll, control enter key submit button

    BrianDH, Jan 12, 2005, in forum: ASP .Net Web Controls
    Replies:
    3
    Views:
    342
    Anders Matthiessen
    Jan 12, 2005
  5. David Thielen

    3 step wizard - ignore last step

    David Thielen, Oct 23, 2006, in forum: ASP .Net Web Controls
    Replies:
    3
    Views:
    220
    Steven Cheng[MSFT]
    Oct 24, 2006
Loading...

Share This Page