views:

353

answers:

1

Hello, I am using struts2 with jsp. In Jsp, i have a table in which few rows of data are present. I have used iterators to display row data of table. Each row contains a button to update the row data(like priority of row data). I am trying to use javascript to update row data when a button is clicked. I am not able to access the value of button. I am not able to find which button is clicked (since one button is present for eahc row of data). I tried using below script. not working. :(

function show_alert() { var partnumber = document.getElementById("stop").Value; alert(partnumber); } Also, please let me know if it is possible to access values of struts2 tag values (which are with in iterator tag).
Please help me out.

Thanks in advance. regards, hemanth.

+1  A: 

You'll need make the buttons have unique ids. You can use the iterator's status object to appending the index to the id.

http://struts.apache.org/2.1.6/docs/iterator.html

Nate