473,387 Members | 1,481 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Altering function of keypress for listbox


....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
4 2777
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
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
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

"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Joneseyboy | last post by:
Hi, I'm new to this so I could really do with some help! I am using VB.net to create a small game. basically there is a Textbox, a button and a listbox. The user enters a number into the...
3
by: Scott | last post by:
I have a function named MyFunction in a standard module that creates a semi-colon delimited list. I want to use this list for the value list in a listbox. I have the row source type property set to...
0
by: Keith Smith | last post by:
Let's say that I have these items in my listBox... Monday Tuesday Wednesday Thursday Friday ....and then I press "T". The selector will automatically move to "Tuesday". How can I keep...
4
by: Tom | last post by:
I have a VB.NET user control that I wrote - this control has three or four other controls on it (textbox, combobox, datetime picker, etc). Now, whenever the control is on a form and the user enters...
5
by: pa2ratczi | last post by:
Hi everyone,,, Can someone tell me, how to use the KeyPress Function? what is the command for a KeyPress function? thank you
11
by: The Frog | last post by:
Hi all, Maybe I am just missing something simple here, but I seem to have an issue with a callback function in A97 that is used to fill a Listbox with values. The first time the callback...
1
by: John Smith | last post by:
Hello, I'd like to create a function that will allow users to only enter numbers in some textboxes. I'm trying to create only one function and call it for each textbox.keypress event instead of...
1
by: kairs86 | last post by:
how can i bind the listbox on keypress events.......
2
by: svibuk | last post by:
i have a asp.net list box populated with databae data , autopostback = true wht i need is 1) when double clicked(double click event) i want it to be visible=false 2)i want to move between the...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.