By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,053 Members | 1,595 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,053 IT Pros & Developers. It's quick & easy.

Altering function of keypress for listbox

P: n/a

....still new at this. ...hopefully a simple question

Is there some practical way of altering the function of a keypress in Visual Web.net 2005 using VB without causing a postback on
each keypress? For example: A have a listbox with a number of selections. The up and down keyboard keys change the indicated listbox
selection and by default the <tabkey takes the focus away from the listbox and onto a button that will submit the selection. I'm
attempting to also have the <enterkey take the focus away from the listbox and onto the button, so that two pushes on the <enter>
key will submit the listbox selection (a drop down list will act in this manner by default).

Is this possible?

Thanks

Jeff

--
Posted via a free Usenet account from http://www.teranews.com

Aug 7 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Jeff,
If its possible, I suspect it would be, you would need to use Javascript to
do it. Unfortunately Javascript is not my strong point.

I would recommend you ask "down the hall" in one of the
microsoft.public.dotent.framework.aspnet.* newsgroups.

--
Hope this helps
Jay B. Harlow [MVP - Outlook]
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net
"Jeff" <no**@none.comwrote in message
news:44***********************@free.teranews.com.. .
|
| ...still new at this. ...hopefully a simple question
|
| Is there some practical way of altering the function of a keypress in
Visual Web.net 2005 using VB without causing a postback on
| each keypress? For example: A have a listbox with a number of selections.
The up and down keyboard keys change the indicated listbox
| selection and by default the <tabkey takes the focus away from the
listbox and onto a button that will submit the selection. I'm
| attempting to also have the <enterkey take the focus away from the
listbox and onto the button, so that two pushes on the <enter>
| key will submit the listbox selection (a drop down list will act in this
manner by default).
|
| Is this possible?
|
| Thanks
|
| Jeff
|
|
|
|
|
| --
| Posted via a free Usenet account from http://www.teranews.com
|
Aug 7 '06 #2

P: n/a
Jeff,

Not despite but in addition of Jay's answer, I think you will hardly find
any JavaScript for this.

If needed you can add it in VBNet, using the addattributes or
registratejavascript attributes. But you will probably not find good
Javascript, The reason is that you try to change the standard behaviour of
all the mozila compatible browser UI, something we are so glad of that it
exist.

This means that all or at least most of your current website users will hate
you shorter or later and try to avoid your website.

Just my thougth reading Jays message and thinking why I did not give an
answer on your question.

Cor
"Jeff" <no**@none.comschreef in bericht
news:44***********************@free.teranews.com.. .
>
...still new at this. ...hopefully a simple question

Is there some practical way of altering the function of a keypress in
Visual Web.net 2005 using VB without causing a postback on
each keypress? For example: A have a listbox with a number of selections.
The up and down keyboard keys change the indicated listbox
selection and by default the <tabkey takes the focus away from the
listbox and onto a button that will submit the selection. I'm
attempting to also have the <enterkey take the focus away from the
listbox and onto the button, so that two pushes on the <enter>
key will submit the listbox selection (a drop down list will act in this
manner by default).

Is this possible?

Thanks

Jeff

--
Posted via a free Usenet account from http://www.teranews.com

Aug 7 '06 #3

P: n/a
Cor,
| If needed you can add it in VBNet, using the addattributes or
| registratejavascript attributes. But you will probably not find good
| Javascript, The reason is that you try to change the standard behaviour of
| all the mozila compatible browser UI, something we are so glad of that it
| exist.
I agree. Mozila, vs IE 6-, IE 7+, vs Opera, vs whatever may mean he will
need browser specific Javascript. Or worse specific browsers may just not
support it.

He should be able use Request.Browser to find out which browser, what
version of browser, what version of DOM, what version of Javascript... the
client is using:

http://msdn2.microsoft.com/en-us/lib...t.browser.aspx
Rather then avoid a feature I try to ensure that it "degrades gracefully".
For example I use Request.Browser on my web site to decide if copying on my
samples pages is supported: IE gets the copy button, Firefox doesn't. As the
copy button uses IE specific functionality. (If you have Firefox et al copy
to clipboard java script I would love to use it).

Although I agree, I might avoid his site if his web select control didn't
behave as other web select controls...

Reading his message just now, wont making the button the "submit" button
cause it to submit the page? Without needing to add code. I may need to
review this closer tonight.

--
Hope this helps
Jay B. Harlow [MVP - Outlook]
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net
"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:OZ**************@TK2MSFTNGP02.phx.gbl...
| Jeff,
|
| Not despite but in addition of Jay's answer, I think you will hardly find
| any JavaScript for this.
|
| If needed you can add it in VBNet, using the addattributes or
| registratejavascript attributes. But you will probably not find good
| Javascript, The reason is that you try to change the standard behaviour of
| all the mozila compatible browser UI, something we are so glad of that it
| exist.
|
| This means that all or at least most of your current website users will
hate
| you shorter or later and try to avoid your website.
|
| Just my thougth reading Jays message and thinking why I did not give an
| answer on your question.
|
| Cor
|
|
| "Jeff" <no**@none.comschreef in bericht
| news:44***********************@free.teranews.com.. .
| >
| ...still new at this. ...hopefully a simple question
| >
| Is there some practical way of altering the function of a keypress in
| Visual Web.net 2005 using VB without causing a postback on
| each keypress? For example: A have a listbox with a number of
selections.
| The up and down keyboard keys change the indicated listbox
| selection and by default the <tabkey takes the focus away from the
| listbox and onto a button that will submit the selection. I'm
| attempting to also have the <enterkey take the focus away from the
| listbox and onto the button, so that two pushes on the <enter>
| key will submit the listbox selection (a drop down list will act in this
| manner by default).
| >
| Is this possible?
| >
| Thanks
| >
| Jeff
| >
| >
| >
| >
| >
| --
| Posted via a free Usenet account from http://www.teranews.com
| >
|
|
Aug 8 '06 #4

P: n/a

"Jay B. Harlow [MVP - Outlook]" <Ja************@tsbradley.netwrote in message news:%2****************@TK2MSFTNGP02.phx.gbl...
>
Although I agree, I might avoid his site if his web select control didn't
behave as other web select controls...

Reading his message just now, wont making the button the "submit" button
cause it to submit the page? Without needing to add code. I may need to
review this closer tonight.

--
Hope this helps
Jay B. Harlow [MVP - Outlook]

I should clarify that this was intended not for a public use web site, but rather for something very specific to use for collecting
data from people who were invited (and paid) to participate. I'm attempting to take them as rapidly as possible through a series of
questions/answers without jumping from the keyboard to the mouse and back again. It isn't practical to install an application on
their machines, so we are using a browser based interface. So yes, you are correct that this would not generally be a good idea for
another use.

Jeff


--
Posted via a free Usenet account from http://www.teranews.com

Aug 8 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.