• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HTML Input onClick event

 
Steve Dyke
Ranch Hand
Posts: 1621
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64959
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why do you need a click event versus a focus event?
 
Steve Dyke
Ranch Hand
Posts: 1621
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64959
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic