Mailing List Archive
tlug.jp Mailing List tlug archive tlug Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][tlug] When should an "onChange" event actually change?
- Date: Tue, 17 Aug 2010 14:51:55 +0900
- From: Dave M G <dave@example.com>
- Subject: [tlug] When should an "onChange" event actually change?
- User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.11) Gecko/20100713 Thunderbird/3.0.6
TLUG,Javascript type question here, though this might have to do with browser differences as well.I've got a form that has text fields to enter in a username and password, and a submit button. I'm using Javascript to evaluate the content of the fields, to make the submit button be greyed out until certain criteria are met. For example, ensuring the text is more than 6 characters and so on. When the two fields are filled in and pass all the criteria, the submit button turns green.I use the "onChange" event to call the necessary functions that do the evaluating and change the button style properties.Works basically fine. However, the timing is a little off. If I fill in both fields correctly, the button only turns green if I shift focus away from the text fields. So, I'll type in a user name, switch to the password field and type that in. When I type in the complete password, the button isn't green yet. If I click somewhere else on screen, *then* the button turns green.It's as if "onChange" is behaving like what you might call a "mouse out", or an "onChangeOfFocus". I thought "onChange" mean whenever you changed the content of the text field.It seems to me I've been to sites where the Javascript evaluates the content of a text field as it is typed.Am I not understanding the expected "onChange" behaviour, or is it that I need to do something else, or in a addition, to get more immediate feedback from my Javascript?Thank you for any advice. -- Dave M G
- Follow-Ups:
- Re: [tlug] When should an "onChange" event actually change?
- From: Edmund Edgar
- Re: [tlug] When should an "onChange" event actually change?
- From: Darren Cook
- Re: [tlug] When should an "onChange" event actually change?
- From: Kyle Hasegawa
Home | Main Index | Thread Index
- Prev by Date: Re: [tlug] Something's not right about my JSON [SOLVED]
- Next by Date: Re: [tlug] When should an "onChange" event actually change?
- Previous by thread: [tlug] Digital Garage as new Meeting Host
- Next by thread: Re: [tlug] When should an "onChange" event actually change?
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links