Using ENTER key to navigate thru' RadioButtonList

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default Re: Using ENTER key to navigate thru' RadioButtonList

    i am able to trap the EnterKey .

    radiopayment.Attributes.Add("onkeypress", "return handleEnter(this, event)")
    and then in the javascript
    function handleEnter (field, event)
    {
    var keyCode = event.keyCode ? event.keyCode : event.which ? event.which :
    event.charCode;
    if (keyCode == 13) {
    // this one is used to navigate thru' the other form elements and not within
    the radiobutton. so i would have to replace the lines below with that
    miracle code which is the functionality of the arrow keys.
    var i;
    for (i = 0; i < field.form.elements.length; i++)
    if (field == field.form.elements[i])
    break;
    i = (i + 1) % field.form.elements.length;
    field.form.elements[i].focus();

    return false;

    }
    else
    return true;
    }

    Thank You

    Sean


    "S. Justin Gengo" <sjgengo@aboutfortunate.com> wrote in message
    news:egZpCKtVDHA.2252@TK2MSFTNGP10.phx.gbl...
    You could capture the enter key whenever the radio button's have focus and
    return a tab instead.

    I'm not sure how to do this exactly but I'm certain it could be done.

    --
    S. Justin Gengo, MCP
    Web Developer

    Free code library at:
    [url]www.aboutfortunate.com[/url]

    "Out of chaos comes order."
    Nietzche
    "Sean" <nospam@> wrote in message
    news:eSmE3HtVDHA.2156@TK2MSFTNGP11.phx.gbl...
    hi,

    is there a way to navigate through a radiobuttonlist by using the Enter Key
    (keycode=13)


    Any suggestion/advice is welcomed and appreciated.

    --
    Thank You,
    Sean


    Sean Guest

  2. Similar Questions and Discussions

    1. Navigate a 3d world
      Hi all, I'm not sure how to explain this. I have a wrl of a room and I could control the camera using the available Dolly and pan behaviors. I am...
    2. How to navigate...
      Hi My problem is probably simple. But I do not know, how to obtain directory from a client, to store a downloaded file. I mean, client can to...
    3. Navigate multiple PDF files
      I have a large book split into multiple PDF files. Basically one file per chapter. Currently the navigation from one chapter to the next works by...
    4. Using variables to navigate
      I wanted to title this "Am I taking CRAZY PILLS??", but opted for the current title Ok...it seems so simple, but obviously I must be missing...
    5. Navigate - specifying URLs to link to
      I have created a signpost that I want to use to navigate to various web pages pointed to by the direction indicators on the signpost graphic, I...
  3. #2

    Default Re: Using ENTER key to navigate thru' RadioButtonList

    Thank You Raj.. it works great, to replace the tab with the enter key.

    but it doesn't seem to work within the the radiobuttons, say to jump from
    'Yes' to 'No'

    it just jumps out from 'Yes' to the next form element.

    I hope there is someway to do so.

    Cheers
    Sean

    "Raj Anand" <rajanandmcp@yahoo.com> wrote in message
    news:045801c356d5$60213e40$a301280a@phx.gbl...
    > you use this javascript call it in pageLoad. It act
    > as 'ENTER Key' as Tab key.
    >
    > function document.onkeypress()
    > {
    > var e = event.srcElement;
    >
    > if (event.keyCode == 13 && (e.type == "radio"))
    > event.keyCode = 9;
    > }
    >
    > window.document.onkeydown = document.onkeypress;
    >
    > Raj Anand, MCP
    >
    >
    >
    >

    Sean Guest

  4. #3

    Default Re: Using ENTER key to navigate thru' RadioButtonList

    Sean,

    I should have thought of that when I first answered you. Tab moves off the
    radio buttons also. You'll need to change the enter key into the code for a
    right cursor...

    Try changing the enter key to a value of 39 (right cursor)

    --
    S. Justin Gengo, MCP
    Web Developer

    Free code library at:
    [url]www.aboutfortunate.com[/url]

    "Out of chaos comes order."
    Nietzche
    "Sean" <nospam@> wrote in message
    news:u0LRyxtVDHA.2024@TK2MSFTNGP12.phx.gbl...
    > Thank You Raj.. it works great, to replace the tab with the enter key.
    >
    > but it doesn't seem to work within the the radiobuttons, say to jump from
    > 'Yes' to 'No'
    >
    > it just jumps out from 'Yes' to the next form element.
    >
    > I hope there is someway to do so.
    >
    > Cheers
    > Sean
    >
    > "Raj Anand" <rajanandmcp@yahoo.com> wrote in message
    > news:045801c356d5$60213e40$a301280a@phx.gbl...
    > > you use this javascript call it in pageLoad. It act
    > > as 'ENTER Key' as Tab key.
    > >
    > > function document.onkeypress()
    > > {
    > > var e = event.srcElement;
    > >
    > > if (event.keyCode == 13 && (e.type == "radio"))
    > > event.keyCode = 9;
    > > }
    > >
    > > window.document.onkeydown = document.onkeypress;
    > >
    > > Raj Anand, MCP
    > >
    > >
    > >
    > >
    >
    >

    S. Justin Gengo Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139