File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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: 9189

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.

[How To Ask Questions On JavaRanch]
I agree. Here's the link:
subject: Calculation in jsp table for each row
It's not a secret anymore!