Question
Binding: Javascript?
I have an input form set up for financials, and I would like
for the subtotals boxes at the bottom to add together whatever the
user enters into the text boxes (dynamically). I am using standard
text boxes (input instead of cfinput), and I have not set up the
form yet (using spry tabs, and when I try to have them all on the
same form, they "un-tab" - different subject).
At first I thought I could just bind the subtotal text boxes to the input boxes:
<input id="SubTotal_1" type="text" bind="{Fund1_1}+{Fund1_2}+{Fund1_3}/>
but when I enter numbers in the input boxes, nothing shows up in the subtotal box. Then I though maybe a function would work so I set up a JavaScript function:
<script type="text/javascript">
Function doAdd(a,b,c)
{SumX=a+b+c;
return SumX;}
</script>
When I call the doAdd() function in a button or something, it works, but I want it to be dynamic. Any ideas?
At first I thought I could just bind the subtotal text boxes to the input boxes:
<input id="SubTotal_1" type="text" bind="{Fund1_1}+{Fund1_2}+{Fund1_3}/>
but when I enter numbers in the input boxes, nothing shows up in the subtotal box. Then I though maybe a function would work so I set up a JavaScript function:
<script type="text/javascript">
Function doAdd(a,b,c)
{SumX=a+b+c;
return SumX;}
</script>
When I call the doAdd() function in a button or something, it works, but I want it to be dynamic. Any ideas?
