I have a web page that displays multiple records for a company. The
input text boxes that display my data are created dynamically. I'm
creating these input boxes dynamically because the number of records
for each company varies. The name of each input box increments by one
for each record (Ex: A1, B1, C1 | A2, B2, C2, etc..)
On my web page the user will enter in a number into the
txtGrossPayroll(some number) input box. I have added an
OnKeyDown="ComputePremium()" and an OnKeyUp="ComputePremium()" inside
my input boxes. When the user begins to type in a number the following
script runs and displays the premium inside the txtPremium(some number)
input box.
<script type="text/javascript" language="JavaScript">
<!--
function ComputePremium() {
document.ScheduleForm.txtPremium1.value =
Math.round((document.ScheduleForm.txtRate1.value *
(document.ScheduleForm.txtGrossPayroll1.value / 100)), 0);
}
// -->
</script>
Currently, I have the script so that it will only run for my 1st row of
records. Can the script be modified so that it is intelligent enough
to know the correct input box name to use? If so how?
I'm not very familiar with JavaScripts; sorry if this is something that
is very easy to do.
Thanks!
CR Junk