• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

handling onclick event by creating buttons dynamically

 
Pragnyan Dalei
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


I am not getting why this code is not working . :( can Any one suggest how to handle this onclick event. I am generating the button dynamically. when I click on the button I need some funtionality to be done.here I want to display 1 alert message.

Thanks in advance.

[Edit - added code tags - MB]
 
Matthew Brown
Bartender
Posts: 4565
8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'd recommend looking at the error console or a Javascript debugger and seeing if you get any errors recorded. If you do, and that doesn't make the problem clear, let us know what the error was.
 
Pete Nelson
Ranch Hand
Posts: 147
Debian Eclipse IDE Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why are you using java scriptlet in your JSP? One of the first things you're going to hear in this forum is to replace your scriptlet code with JSTL.

However, I think the bigger problem may be the javascript assignment of the variable event:

Where is "event" being assigned here?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64617
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Indeed. Java scriptlets have been discredited since 2002 when JSP 2 was introduced. Using scriptlets in moderne JSP pages is nothing short of irresponsible.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic