The moose likes HTML, CSS and JavaScript and the fly likes Calculation in jsp table for each row Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Calculation in jsp table for each row" Watch "Calculation in jsp table for each row" New topic

Calculation in jsp table for each row

biswajit kr das

Joined: Jun 23, 2013
Posts: 1
I have a table in jsp which have 3 columns- num1, num2, sum

I want to display the sum automatically for each of the row. Above code works only for the first row, but not for the other rows. I am not sure how to achieve that. Thanks in advance
Joe Ess

Joined: Oct 29, 2001
Posts: 8836

Welcome to the JavaRanch.
You have hard coded the names of the fields in the function. You need a way to tell which row you are on and which fields you are using. Any ideas?
I'm going to move this to the javascript forum since this isn't really a Struts problem.

"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
I agree. Here's the link: http://aspose.com/file-tools
subject: Calculation in jsp table for each row
Similar Threads
adding values in the textbox and put total in same
Jsp file not compling
How to retain automatically generated fields on pageload in struts2
spaces while populating using s:iterator
Null value is coming