Compute values in table using javascript with values from sql query and display it on the table

the java script applies only to the 1st product but when i try it to the following data my java script doesnt work it does not print out the values in the tier3 column next to the equal sign

what should i do thanks in advance, here is the java script and some php code

I would think you’d need to figure out some way to differentiate each line of your HTML table, so that the javascript can know which row you’re referring to. At the moment, each row of the table has an input element with an id of compute, and another of msg for the result, and some hidden variables. But they’re all called the same thing, so how will the code know which you refer to? An easy workaround might just be to add a count variable on the end of each id, and pass that into the javascript function. Having multiple page elements with the same id is (or was) invalied anyway.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.