473,408 Members | 1,867 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,408 software developers and data experts.

onchange AND onblur AND onkeypress

Sorry for the double post, but I got no responses from the first
group...

I have a sample page. See link.

http://comptrex.com/star/startest.htm

It has a select box that contains a list of countries. It also has a
div that contains the same list of countries, with a checkbox next to
them. The user can check the checkbox next to the country, then
submit to some processing page. However, if this list gets too long,
they won't want to scroll throught the entire list, so I made the
select box above. The user can find the country they want in the
select box, and the onchange event will check the country in the list
below.

So far everything is good.

Now, If the list is really long, the user will need to scroll through
the list box to find the country, so I added code that will allow the
user to type in part of the name, and it will find them in the list
box. This works well.

The problem is, I can't get the two functions to work together. If
the user searches for a country by typing in the select box, clicking
on the country, or the return, selects the country in the list box,
but won't fire the onchange event. I had to add a link to select it.
I don't want to do this.

Long story short, can anyone figure out how to get the onchange event
to fire after a user has entered in some characters to search for?

I appreciate any help.

- Mark

Aug 22 '07 #1
2 3453
Mark wrote:
Long story short, can anyone figure out how to get the onchange event
to fire after a user has entered in some characters to search for?
`change' is simply the *wrong event*, it SHOULD NOT work for this.
Try `keypress' and `keyup'.

http://www.w3.org/TR/DOM-Level-2-Eve...ngs-htmlevents
http://www.w3.org/TR/DOM-Level-3-Eve...nts-Interfaces
PointedEars
--
"Use any version of Microsoft Frontpage to create your site. (This won't
prevent people from viewing your source, but no one will want to steal it.)"
-- from <http://www.vortex-webdesign.com/help/hidesource.htm>
Aug 22 '07 #2
Thanks for the reply.

I'll give it a go.

- Mark

Aug 22 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Asit | last post by:
In JavaScripts checks for an onChange event against the value of the textbox at the time of the last onChange event. Since an onChange Event never fired after you changed the text first time ,...
2
by: Quinn | last post by:
HI! Have two from text fields named "odds" and "stake" where I enter numeric values. I want to have a text label named "returns" that is automatically updated whenever any of these changes. ...
11
by: Bob Bedford | last post by:
I'd like to fire a JS function from the Onchange event of a Text edit. Unfortunately it doesn't fire when I hit any key, but only when leaving the control. I've tried with OnKeyup, and it works,...
1
by: Christoph | last post by:
I'm trying to validate some HTML form elements when the user tabs out of each element. However, I'm having some problems. It appears that the order of events is onChange followed some time...
2
by: crjunk | last post by:
I have a javascript that will output a message telling the user that changes were made. It halfway works. If the user enters in a number, the TextChanged function executes and displays the...
3
by: jab3 | last post by:
Hello. I"m new to this group, and to JavaScript in general, so please forgive me if I breach local etiquette. I'm trying to implement some client-side 'dynamic' validation on a form. I'm having...
1
by: Stewart | last post by:
Dear All, I discovered last night that IE6 doesn't support the onchange event on the form object. I had written some script in Firefox, and tested in IE, and spent a long time trying to debug...
3
by: itp | last post by:
I have moved to Matt Kruse's Javascript Toolbox. It has some great examples to get you going quickly! Unfortunately all the examples are based on a form/submit model. I would like to try using...
1
by: pankajprakash | last post by:
hi, i have a web application. and i am using a textbox there. I write the onblur and onkeypress event on the textbox. but when i press the key on the textbox that time onblur event is also called,...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
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...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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...

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.