This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes Javascript input text event Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Javascript input text event" Watch "Javascript input text event" New topic

Javascript input text event

Srilatha Vangala

Joined: Apr 15, 2008
Posts: 2
In my application I am using AJAX for form auto completion. As soon as the user enters the Id, the corresponding information from the database is displayed in the other fields automatically.

I am using <input type="text" onchange="somemethod()">

The problem with onchange event is, if the user chooses the Id from the previousely used values catched by the browser, it is not working.

Is there a better event than onchange for doing this. I tried using onblur event.But its not supported by some of the browsers. Or, is there a way to stop the browser from remembering the previousely entered values?

Eric Pascarello

Joined: Nov 08, 2001
Posts: 15376
onblur is supported by every major browser I can think of.

Srilatha Vangala

Joined: Apr 15, 2008
Posts: 2
I am new to Ajax.When I tried onblur previously, it didn't work properly with IE. Its working now. Thanks
I agree. Here's the link:
subject: Javascript input text event
Similar Threads
correct Ajax script syntax for second DropDown
How to call action on onchange event with select option in struts2
OnChange and Calander popup
Multiple Select box Problem
Regarding readOnly property of input type control in html.