aspose file tools*
The moose likes JSP and the fly likes pass jstl value to javascript Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "pass jstl value to javascript" Watch "pass jstl value to javascript" New topic
Author

pass jstl value to javascript

anvi kon
Ranch Hand

Joined: Jan 08, 2010
Posts: 133

Whenever I click the checkbox I need to pass the corresponding name from jstl to the javascript function.
Here is the code.


I need help on this.


Thanks

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61187
    
  66

What is it you need help on? You showed us code without stating what your issue is.

Remember that you don't "pass" anything between JSP and JavaScript. The JSP just creates the HTML file to send to the browser. So if you need a server-side data value in the JavaScript you just write it into the JavaScript code.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
anvi kon
Ranch Hand

Joined: Jan 08, 2010
Posts: 133
sorry!!! I forgot to write the issue .

In the javascript using the below code, whenever I click the checkbox I can capture all the names for ex: test1,test2, test3...., but I want only the corresponding name test2
to the checked checkbox.






Thanks,
Stefan Evans
Bartender

Joined: Jul 06, 2005
Posts: 1018
You generate the checkboxes like this:



I presume this is the struts html:multibox tag?

In that case, I think what you are after is the value of the current checkbox:

anvi kon
Ranch Hand

Joined: Jan 08, 2010
Posts: 133
It worked. Thanks a lot for your help.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: pass jstl value to javascript