|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Altering function of keypress for listboxIs 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 <tab> key takes the focus away from the listbox and onto a button that will submit the selection. I'm attempting to also have the <enter> key 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 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" <n***@none.com> wrote in message Visual Web.net 2005 using VB without causing a postback onnews:44d6b51b$0$31419$88260bb3@free.teranews.com... | | ...still new at this. ...hopefully a simple question | | Is there some practical way of altering the function of a keypress in | 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 <tab> key takes the focus away from the listbox and onto a button that will submit the selection. I'm| attempting to also have the <enter> key 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).Show quoteHide quote | | Is this possible? | | Thanks | | Jeff | | | | | | -- | Posted via a free Usenet account from http://www.teranews.com | 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 Show quoteHide quote "Jeff" <n***@none.com> schreef in bericht news:44d6b51b$0$31419$88260bb3@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 <tab> key takes the focus away from the > listbox and onto a button that will submit the selection. I'm > attempting to also have the <enter> key 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 > Cor,
| If needed you can add it in VBNet, using the addattributes or I agree. Mozila, vs IE 6-, IE 7+, vs Opera, vs whatever may mean he will | 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. 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/library/system.web.httprequest.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. -- Show quoteHide quoteHope this helps Jay B. Harlow [MVP - Outlook] ..NET Application Architect, Enthusiast, & Evangelist T.S. Bradley - http://www.tsbradley.net "Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> wrote in message news:OZQigMjuGHA.1288@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" <n***@none.com> schreef in bericht | news:44d6b51b$0$31419$88260bb3@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 <tab> key takes the focus away from the | > listbox and onto a button that will submit the selection. I'm | > attempting to also have the <enter> key 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 | > | | "Jay B. Harlow [MVP - Outlook]" <Jay_Harlow_***@tsbradley.net> wrote in message news:%230CZJMvuGHA.4612@TK2MSFTNGP02.phx.gbl... I should clarify that this was intended not for a public use web site, but rather for something very specific to use for collecting> > 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] 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
Update problem ADO vbnet 2005
Remoting - Some methods hang on certain setups. Getting database fields (rows) to appear as columns in datagrid Convert DAO from VB6 to VB8? Hyperlink and Label Update a structure when another structure changes Showing a form from within a thread Wildcards Random Databinding datagridview to textbox |
|||||||||||||||||||||||