wood burning stoves 2.0*
The moose likes HTML, CSS and JavaScript and the fly likes handling onclick event by creating buttons dynamically Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "handling onclick event by creating buttons dynamically" Watch "handling onclick event by creating buttons dynamically" New topic
Author

handling onclick event by creating buttons dynamically

Pragnyan Dalei
Greenhorn

Joined: Dec 28, 2011
Posts: 11


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

Joined: Apr 06, 2010
Posts: 4343
    
    8

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

Joined: Aug 30, 2010
Posts: 147

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?


OCPJP
In preparing for battle I have always found that plans are useless, but planning is indispensable. -- Dwight D. Eisenhower
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60776
    
  65

Indeed. Java scriptlets have been discredited since 2002 when JSP 2 was introduced. Using scriptlets in moderne JSP pages is nothing short of irresponsible.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: handling onclick event by creating buttons dynamically
 
Similar Threads
URL parameters not getting passed during javascript submit
Getting duplicate values on the onChange event of dropdown list
Get Rows from a Table
spaces while populating using s:iterator
Submit popup