| 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
|
|
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.
|
 |
 |
|
|
subject: pass jstl value to javascript
|
|
|