My bad for being so vague cLFlaVA. I really appreciate your (and everyones) help.
But yeah just like I had it...
I have this for loop on my asp page where the user enters cost & qty in the fields and then it automatically calculates the total and displays it...
<% For I = 1 To 10 %>
<tr>...
I hope so cLFlaVA,
If I do each function one at a time (like below)the "fuction calculate()" will work with "OnChange="calculate<%=I%>()".
I wanted to use a for loop on this to keep it clean.
On another note, how to add numeric validation to it?
function calculate1()
{
var a =...
Thanks cLFlaVA
But I was getting errors on that one.
What I'm trying to accomplish is...
<% For I = 1 To 10 %>
<tr>
<td>name="cost<%=I%>" value="<%=ncost(I)%>" type="text"></td>
<td><input class="frm2" name="qty<%=I%>" value="<%=nqty(I)%>" type="text" OnChange="calculate<%=I%>()"></td>...
Hi javascript gurus,
How can I make it so that "function calculate()", "cost", "qty" and "value" become...
calculate1(), cost1, qty1, value1
calculate2(), cost2, qty2, value2...etc?
<script language="JavaScript">
for (i = 0; i <= 10; i++)
function calculate()
{
var a =...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.