473,786 Members | 2,399 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

TEXT OnChange

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, but it isn't compatible with
NS6.

Please any advice ?

Best regards.

Bob
Jul 23 '05 #1
11 1724
In article <41************ *********@news. sunrise.ch>, bedford1
@YouKnowWhatToD oHerehotmail.co m enlightened us with...
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, but it isn't compatible with
NS6.


No, onchange doesn't fire unless focus leaves the element.

Try onkeypress, depending on what you're trying to accomplish. Sometimes it's
a fine substitute, sometimes it isn't.

--
--
~kaeli~
The man who fell into an upholstery machine is fully
recovered.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #2
OnKeyPress is the same than OnKeyUp, it doesn't work with NS6
I will add an additional window.

Thanks

Bob

"kaeli" <ti******@NOSPA M.comcast.net> a écrit dans le message de
news:MP******** *************** *@nntp.lucent.c om...
In article <41************ *********@news. sunrise.ch>, bedford1
@YouKnowWhatToD oHerehotmail.co m enlightened us with...
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, but it isn't compatible with NS6.

No, onchange doesn't fire unless focus leaves the element.

Try onkeypress, depending on what you're trying to accomplish. Sometimes

it's a fine substitute, sometimes it isn't.

--
--
~kaeli~
The man who fell into an upholstery machine is fully
recovered.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #3
Bob Bedford wrote:
OnKeyPress is the same than OnKeyUp,
It's not quite the same:
http://www.w3.org/TR/html4/interact/...def-onkeypress
it doesn't work with NS6


Since they are both described in the w3.org HTML 4.01 standard, why not
just use it and advise users to get a compliant browser (such as NS7)?

--
Ben M.
Jul 23 '05 #4
On Tue, 14 Sep 2004 17:11:33 GMT, Ben Measures wrote:
it doesn't work with NS6


Since they are both described in the w3.org HTML 4.01 standard, why not
just use it and advise users...


Advise users? If some web-site author
'advised' me to get a decent browser
I'd advise them to get a working site
(assuming imparting that advice was quicker
than the 'back' button, which, since it's
not, leave's the site in the lurch).

Who cares? ( I mean, ..besides the site author. )

--
Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology
Jul 23 '05 #5
Andrew Thompson wrote:
Ben Measures wrote:
it doesn't work with NS6


Since they are both described in the w3.org HTML 4.01 standard, why not
just use it and advise users to get a compliant browser?


Advise users? If some web-site author
'advised' me to get a decent browser
I'd advise them to get a working site


All an author can do to help interoperabilit y is to code to the w3.org
standards and add workarounds for broken browsers. In the case of onkey*
there is no workaround - if a browser doesn't support it no workaround
can be written to emulate it.

So all the OP can do now is use this attribute (as specified in the
w3.org standards) and advise users to use a standards-compliant browser.
Since there are no workarounds he is fully justified in doing this.

If even the features of the specifications given by w3.org are taboo
then what hope is there for the progression of the www?

--
Ben M.
Jul 23 '05 #6
In article <9D************ *******@news-text.cableinet. net>,
sa************* ***@removehotma il.com enlightened us with...
Bob Bedford wrote:
OnKeyPress is the same than OnKeyUp,


It's not quite the same:
http://www.w3.org/TR/html4/interact/...def-onkeypress
it doesn't work with NS6


Since they are both described in the w3.org HTML 4.01 standard, why not
just use it and advise users to get a compliant browser (such as NS7)?


Is that true that NN6 doesn't support that, but NN7 does?

Oh, my bad.
I thought NN6 was fully html 4.01 compliant.
I learn something new daily.
--
--
~kaeli~
You can't have everything. Where would you put it?
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #7
Andrew Thompson wrote:
Ben Measures wrote:
it doesn't work with NS6


Since they are both described in the w3.org HTML 4.01
standard, why not just use it and advise users...


Advise users? If some web-site author
'advised' me to get a decent browser
I'd advise them to get a working site
(assuming imparting that advice was quicker
than the 'back' button, which, since it's
not, leave's the site in the lurch).

Who cares? ( I mean, ..besides the site author. )


With no code presented to demonstrate that there even is a problem with
Netscape 6, rather than an authoring mistake, it would be premature to
be bothering the user about their choice of browser.

Richard.
Jul 23 '05 #8
kaeli wrote:

I thought NN6 was fully html 4.01 compliant.
I learn something new daily.


AOL/Netscape prematurely released NN6. It was based on pre-1.0 Mozilla
(iirc it was based on M18, pre-0.6). Inevitably there were bugs,
incompatibiliti es and general brokeness. It should never have happened.

It was only when NN7 was released (based on post-1.0 Mozilla code) that
it became anywhere near the standards-compliant browser that it is today.

--
Ben M.
Jul 23 '05 #9
onkeypress should work with Netscape 6. I am almost certain I used it
successfully. However, if you are trying to add it programmaticall y:

document.forms['myForm'].elements['myElement'].onkeypress = myHandler;

Then you need the following code in your <form>

<input type="text" name="myElement " value="" onkeypress="">

The empty onkeypress="" is _not_ optional in some early versions of Gecko-based
browsers if you are trying to add an event handler programmaticall y. These
early versions of Gecko-based browsers had a problem where if event handlers
were not registered when the HTML was parsed, your event would be attached
_after_ the standard application-level event handler.

The following code snippet should work just fine in Netscape 6 (I tested it in
Mozilla 1.0 and it generated the correct alert() on each keypress):

<body onload="
document.forms['myForm'].elements['myElement'].onkeypress =
function (e) {
alert('You pressed ' + (e && e.which ? e.which : event.keyCode)) ;
}
">
<form name="myForm">
<input type="text" name="myElement " value="" onkeypress="">
</form>
</body>

Bob Bedford wrote:
OnKeyPress is the same than OnKeyUp, it doesn't work with NS6
I will add an additional window.

Thanks

Bob

"kaeli" <ti******@NOSPA M.comcast.net> a écrit dans le message de
news:MP******** *************** *@nntp.lucent.c om...
In article <41************ *********@news. sunrise.ch>, bedford1
@YouKnowWhatToD oHerehotmail.co m enlightened us with...
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, but it isn't compatible with NS6.


No, onchange doesn't fire unless focus leaves the element.

Try onkeypress, depending on what you're trying to accomplish. Sometimes

it's
a fine substitute, sometimes it isn't.


--
Grant Wagner <gw*****@agrico reunited.com>
comp.lang.javas cript FAQ - http://jibbering.com/faq
Jul 23 '05 #10

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

Similar topics

2
18089
by: C. David Rossen | last post by:
Hello: I have a registration form for classes. Each class has a fee. I have a drop down box whereby the user chooses his class. There is a textbox with the associated fee. I would like to auto populate the fee textbox depending on what class the user chooses. In the email, the value of the drop down box has to be the name of the class and the value of the fee text box has to be the fee. Can someone please help me in accomplishing...
4
31048
by: ms | last post by:
I have come across a problem where if a user enters the same text into a text input after the value has been programmatically changed, the onChange event does not fire for the second change. The following code demonstrates this: <html> <body> <input type=text value='yyy' onchange="this.value='xxx'"></input> <input type=text value='2'></input>
11
26327
by: Randell D. | last post by:
Folks, I have seven text boxes which will contain measurements - I would like the user to input their values in the order that I have listed the boxes. How can I therefore make an input type=text name=box2 a readonly while type=text name=box1 has a length of zero? This is for an intranet based application and I understand all the arguements and points that one has to consider in such that my server
7
2933
by: juglesh | last post by:
Hello, I would like to be able to have the user sort a list of items similarly to the way you sort your queue on Netflix.com. (the numbers dont change dynamically on netflix, they must be doing something serverside with them) Like this: ( represents a text or select filed) an item something else a differnt thing the other
4
9698
by: mflll | last post by:
I am looking into the different techniques of handling arrays of edit boxes in Java Script. The first program below works fine. However, are there better ways of doing this, where the person writing the JavaScript doesn't have to pass the index in the "onChange" event name. I thought that one might be able to use "this.value" or compare this as
4
2184
by: sherifffruitfly | last post by:
Hi, I'm using StatusBar text to inform the user what's going on in the application. I pass a reference to from the main form's class to other (instances of) classes that are doing the actual work, and they update the Text property in various ways. It would be slick (imo) if, after the user is informed about the antics of some class-instance, if the StatusBar text would revert back to some default text-variable in the main form class...
18
25006
by: Diogenes | last post by:
Hi All; I, like others, have been frustrated with designing forms that look and flow the same in both IE and Firefox. They simply did not scale the same. I have discovered, to my chagrin, that IE7 does not seem to offer any way to control the font size of a text input element.
7
3133
by: kirkgilbert | last post by:
I am trying to do an onchange event in a form using a text field. The form is tied to a record set that is part of a repeated region. One the first record when I edit the data it works perfectly. When I go to the second record nothing happens. I have attached the code below: I bolded text that contains the javascript and fields this is applied to <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%> <!--#include file="Connections/FutureOrders.asp"...
0
10360
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10163
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 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...
1
10108
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,...
0
9960
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8988
agi2029
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...
1
7510
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6744
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();...
0
5532
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4064
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 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.