Welcome Guest ( Log In | Register )

Outline · [ Standard ] · Linear+

 switching tab key with enter key, in asp.net..any1?

views
     
TSdokidoki
post Feb 26 2006, 08:48 PM, updated 20y ago

I am not War machine~
*******
Senior Member
4,630 posts

Joined: Jul 2005
From: PJ somewhere~


got 1 problem with my project which user want enter key = tab key....how to switch it?..last time in VB we can ezly assign the key..but asp.net seem to be dun have this function...whenever we press enter key then it become submit(this is wat my user dun want)...


TSdokidoki
post Feb 28 2006, 09:52 AM

I am not War machine~
*******
Senior Member
4,630 posts

Joined: Jul 2005
From: PJ somewhere~


QUOTE(dokidoki @ Feb 26 2006, 08:48 PM)
got 1 problem with my project which user want enter key = tab key....how to switch it?..last time in VB we can ezly assign the key..but asp.net seem to be dun have this function...whenever we press enter key then it become submit(this is wat my user dun want)...
*
erm...any comment + suggestion??
sinx
post Feb 28 2006, 10:02 AM

New Member
*
Junior Member
15 posts

Joined: Aug 2005


QUOTE(dokidoki @ Feb 26 2006, 08:48 PM)
got 1 problem with my project which user want enter key = tab key....how to switch it?..last time in VB we can ezly assign the key..but asp.net seem to be dun have this function...whenever we press enter key then it become submit(this is wat my user dun want)...
*
You can't compare it with what you did in VB6.
That one is window-based and your new project is web-based.

You scenario is "Once user press 'enter' then the tab cursor will jump to next field."
You need javascript to implement it.

<script type="text/JavaScript">
<!--
function doKey($key) {
if ($key == 13) {
//Do whatever you want
//i.e. jump to next control

}
}
-->
</script>

<body onKeyPress="doKey(window.event.keyCode)">
TSdokidoki
post Feb 28 2006, 10:03 AM

I am not War machine~
*******
Senior Member
4,630 posts

Joined: Jul 2005
From: PJ somewhere~


QUOTE(sinx @ Feb 28 2006, 10:02 AM)
You can't compare it with what you did in VB6.
That one is window-based and your new project is web-based.

You scenario is "Once user press 'enter' then the tab cursor will jump to next field."
You need javascript to implement it.

<script type="text/JavaScript">
<!--
function doKey($key) {
  if ($key == 13) {
    //Do whatever you want
    //i.e. jump to next control

  }
}
-->
</script>

<body onKeyPress="doKey(window.event.keyCode)">
*
erm....some of my user r using window 95..some 98....wondering will their browser support it or not~..
sinx
post Feb 28 2006, 10:09 AM

New Member
*
Junior Member
15 posts

Joined: Aug 2005


Then you need to figure out whther their browsers can support or not.

I do think javascript is the only way!
Even you use some so-called 'power & friendly' asp.net components, they still end up with a bunch of javascript after interpreted.
PrinceHamsap
post Feb 28 2006, 10:14 AM

Legendary
******
Senior Member
1,637 posts

Joined: Jan 2003
From: Munich , Bangkok, Barcelona , KualaLumpur


use flash ...
if not mistaken flash also can communicate with database as well
TSdokidoki
post Feb 28 2006, 10:35 AM

I am not War machine~
*******
Senior Member
4,630 posts

Joined: Jul 2005
From: PJ somewhere~


QUOTE(PrinceHamsap @ Feb 28 2006, 10:14 AM)
use flash ...
if not mistaken flash also can communicate with database as well
*
lagi teruk...i think my user win95/98 pc wouldnt support this flash la~
cikun
post Feb 28 2006, 12:59 PM

チクォン
****
Senior Member
571 posts

Joined: Jan 2005
From: クアラー ルムポール
yeah, i agree. javascript is the way to go for your project. it's simple and light. can cater for old windows users, provided they have supported browsers - which will not be too much of a deal. limitations on web apps are some things you can't avoid.

 

Change to:
| Lo-Fi Version
0.0155sec    1.06    5 queries    GZIP Disabled
Time is now: 23rd December 2025 - 01:40 PM