Hey folks --
I have a series of selectboxes on a web form. I would like to have a
javascript jump the focus to the next selectbox when the user presses a key.
Each box has the values 1 through 6-9, depending. So normally someone who is
used to it can just hit 1 <tab> 3<tab> 5<tab>1<tab>9<t ab> -- I'd like to
take the tabbing out.
So what's really nice is if the box doesn't jump when the user doesn't
select a proper value.
I've been looking at java scripts and I'm not sure how to reference the next
selectbox, or how to check that the key pressed was in the proper range. Can
someone help me out?
Here's what FireFox's WebDeveloper .8 says about my form:
Form
Id Name Method Action
questions post ./shop_report.php
Elements
Id Name Type Value
1 select
2 select
3 select
4 select
5 select
6 select
7 select
8 select
9 select
10 select
...
through about 200 or so. 6 1693
Steve Lefevre wrote: I have a series of selectboxes on a web form. I would like to have a javascript jump the focus to the next selectbox when the user presses a key. Each box has the values 1 through 6-9, depending. So normally someone who is used to it can just hit 1 <tab> 3<tab> 5<tab>1<tab>9<t ab> -- I'd like to take the tabbing out.
You are after the element tabIndex property, have a look here: http://www.mozilla.org/docs/dom/domr...f.html#1002691
So what's really nice is if the box doesn't jump when the user doesn't select a proper value.
How can they not select a "proper value"? Perhaps you should
look at making sure the content of the select is only valid
values, rather than pestering the user if they can't guess what
is "proper" and what isn't.
I've been looking at java scripts and I'm not sure how to reference the next selectbox, or how to check that the key pressed was in the proper range. Can someone help me out?
Use the tabIndex property to control navigation. There is also
an item index (look for "item" method at the above reference):
element.item(in dex)
but that is based on the order the elements are placed in the
DOM tree and may not be the same order as your required
tabIndex.
On Sat, 18 Sep 2004 14:50:12 +1000, Fred Oz <oz****@iinet.n et.auau> wrote:
[snip] Use the tabIndex property to control navigation. There is also an item index (look for "item" method at the above reference):
element.item(in dex)
but that is based on the order the elements are placed in the DOM tree and may not be the same order as your required tabIndex.
That documentation is either proprietary, or wrong. Elements do not have
an item method; collections do. Even then it is preferable to use
subscripting as not all browsers may support the item and namedItem
methods.
Mike
--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.
"Fred Oz" <oz****@iinet.n et.auau> wrote in message
news:41******** *************** @per-qv1-newsreader-01.iinet.net.au ... How can they not select a "proper value"? Perhaps you should look at making sure the content of the select is only valid values, rather than pestering the user if they can't guess what is "proper" and what isn't.
What I mean is that I don't think I should use the KeyPress event, because
proper values are only 1 through 6 to 9. So one box might be 1-7, and maybe
the user hits '8', or 'g'. I don't want it jumping to the next box in that
case.
So, yes, the select box does have only proper values in it, but the keyboard
doesn't ;) I've been looking at java scripts and I'm not sure how to reference the
next selectbox, or how to check that the key pressed was in the proper range.
Can someone help me out? Use the tabIndex property to control navigation. There is also an item index (look for "item" method at the above reference):
element.item(in dex)
Can I pass the index as a variable? Or can I just reference the select box
name, passed as a variable to the function? but that is based on the order the elements are placed in the DOM tree and may not be the same order as your required tabIndex.
Post a brief sample that shows what you are trying to do,
otherwise we are just guessing...
Cheers, Fred
"Fred Oz" <oz****@iinet.n et.auau> wrote in message
news:41******** *************** @per-qv1-newsreader-01.iinet.net.au ... Post a brief sample that shows what you are trying to do, otherwise we are just guessing...
The following is the description from the grandparent thread. I don't have
any code attemps, because, like I say, I'm a noobie ;)
I have a series of selectboxes on a web form. I would like to have a
javascript jump the focus to the next selectbox when the user presses a key.
Each box has the values 1 through 6-9, depending. So normally someone who is
used to it can just hit 1 <tab> 3<tab> 5<tab>1<tab>9<t ab> -- I'd like to
take the tabbing out.
So what's really nice is if the box doesn't jump when the user doesn't
select a proper value.
I've been looking at java scripts and I'm not sure how to reference the next
selectbox, or how to check that the key pressed was in the proper range. Can
someone help me out?
Here's what FireFox's WebDeveloper .8 says about my form:
Form
Id Name Method Action
questions post ./shop_report.php
Elements
Id Name Type Value
1 select
2 select
3 select
4 select
5 select
6 select
7 select
8 select
9 select
10 select
...
through about 200 or so.
"Fred Oz" <oz****@iinet.n et.auau> wrote in message
news:41******** *************** @per-qv1-newsreader-01.iinet.net.au ... Post a brief sample that shows what you are trying to do, otherwise we are just guessing...
Aw, heck, here's a brief, non-java psue-code attempt at what I'm after
on KeyUp(MoveToNex t)
MoveToNext{
if ( selected_value is in_selectbox_va lues ) {
goto form.elements.n ext()
}
}
Dig? This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: We need more power captain |
last post by:
Hi,
I know less than a noob, I've been asked to do some compiles in VC++ 6
without knowing too much at all. (I'm a COBOL program normally so
this is all too much for me)
I open VC++6, open the workspace and then:
Build>Batch Build
|
by: Scott Eade |
last post by:
I am using select()/focus() to position the cursor at a particular field
on a form. This works, but when the user presses the Tab key in IE the
cursor jumps to the address bar rather than the next field (Firefox is
fine). Does anyone know why this might be happening and how to stop it?
Below is the code that I use to set the cursor position (it is somewhat
convoluted because it is generated via a series of macros). The cursor
is...
|
by: jalkadir |
last post by:
By jump I mean ending unexpectedly.
The program below, like the jumping beens, has an unusual behaviour.
When the noted lines are not present the program terminates
disregarding the rest of the lines.
I have seen this type of behaviour before, but I can't find to recall
the source, the needy greedy source, of the problem. I, however, was
able to remember that the problem was resolved, temporarily, by using
'std::cin.get()', but I am...
|
by: Mason Barge |
last post by:
I'm learning how to build a website. So far I've gotten pretty good
with HTML, CSS, and Paint Shop Pro, and I'm currenly learning the
basics of Javascript.
I'm hoping, eventually, to build and run an online publication that
will change content daily and have extensive archived articles,
cross-referenced by subject area(s).
What other languages would it make sense for me to learn? CGI, Perl,
PHP, Ajax, SQL are all Greek to me. I do...
|
by: Pupeno |
last post by:
Hello,
I want to jump over a method in the class hierarchy, that is: If I have
class A(object), clas B(A), class C(B) and in C, I want a method to do
exactly what A does but not what B does in its reimplementation, would it
be correct to do: super(A, super(B, self)).method() in C ?
Thank you.
--
Pupeno <pupeno@pupeno.com(http://pupeno.com)
| |
by: Japskunk |
last post by:
I am having trouble updating a SQL table through the GridView "Auto"
Enable Edit Feature...
I am connecting to a SQL 2000 Server with a SQLDataSource
I have created the Update Query in the Command and Parameter Editor
setup when I created my SQLadapter, along with Select and Delete.
Here is the Update Command:
UPDATE TBLUPSData SET UPSModel = @original_UPSModel, UPSLocation =
@original_UPSLocation, UPSDeviceAttached =...
|
by: Buzby |
last post by:
I want a drop down date selection box on a form in the format of Mon 18
June 2007, that will go say 400 days in advance from the current date.
Can anyone point me in the right direction as I appear to be going in
ever decreasing circles . . .
TIA!
--
Buzby
|
by: pinman |
last post by:
hi. i'm pretty much a noob to c# and visual studio and am trying to create a simple login method. i have created a users table in the database and can add users by inputing there md5 encrypted password and a non encrypted username. problem is then checking a user has inputed valid username and passwords. i've created a stored procedure that returns 1 for a valid login and 0 for invalid but don't know if this procedure is the problem
PROCEDURE...
|
by: prathna |
last post by:
Hi I have this following code
<script> function displayFields() { document.getElementById('Label12').style.display = 'none'; document.getElementById('Label13').style.display = 'none'; document.getElementById('Label22').style.display = 'none'; document.getElementById('Label23').style.display = 'none'; } function dispHideFileds() { alert(""); if (document.forms.number.value == 'One') { ...
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |