• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

pass jstl value to javascript

 
anvi kon
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Pie
Posts: 65216
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
anvi kon
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1784
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It worked. Thanks a lot for your help.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic