This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes HTML Input onClick event Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply Bookmark "HTML Input onClick event" Watch "HTML Input onClick event" New topic
Author

HTML Input onClick event

Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1254
I have an input tag on my page with an onClick event attribute. For some reason it has to be clicked twice before the function will fire. It is like the first click sets it's focus so the second click get a handle to is attributes.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56185
    
  13

Why do you need a click event versus a focus event?


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1254
Bear Bibeault wrote:Why do you need a click event versus a focus event?


Never thought about that I always used onclick.

However, I have changed to drop down style list instead of displaying another page to give name list. It looks a whole lot cleaner. I am learning as I go.

But I could not do this without the help you have given.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56185
    
  13

Thanks.

Also, do give thought about what event might be the post appropriate to capture. A lot of people just default to click when at times, focus or change might be more appropriate.

For example, do you think that the click on a dropdown is what's important? Or is the important event the fact that the value has changed?
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: HTML Input onClick event
 
Similar Threads
window.close not submitting properly
how to disable onclick event
strange onclick
How to print out file from the web?
Using onclick in input tag