This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes JSP and the fly likes pass jstl value to javascript Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » JSP
Reply 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: 56554
    
  14

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.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About 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: 1008
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
 
Similar Threads
Coloring Table Rows
Implementation of google charts in JSP
How to getParameter value
check box validation
ArrayList size using JSTL