Howdy, Scripters :)
Im trying to update fields and dom elements based on form inputs:
[HTML]<form action="whateve r">
<fieldset class="calc">
<input type="text" class="charge" />
<input type="text" class="cost" />
<input type="text" class="profit" />
</fieldset>
</form>
[/HTML]
Basically I want to take whatever the user types into the charge field and subtract their cost input, the sum would populate the profit input instantly.
Of course, the fun is just beginning :)
Underneath this form, I have a javascript link which clones the fieldset, so I get another batch of inputs to play with. Due to this, the calculations need to happen within the scope of each "fieldset.c alc"
The icing on the cake is that I need to grab the values of all the inputs on the page of a certain class, sum them up and display them inside a designated div. Something like getElementsbyCl assname perhaps?
I'm not really sure where to begin so any advice would be huge.
Thanks in advance,
PM
Im trying to update fields and dom elements based on form inputs:
[HTML]<form action="whateve r">
<fieldset class="calc">
<input type="text" class="charge" />
<input type="text" class="cost" />
<input type="text" class="profit" />
</fieldset>
</form>
[/HTML]
Basically I want to take whatever the user types into the charge field and subtract their cost input, the sum would populate the profit input instantly.
Of course, the fun is just beginning :)
Underneath this form, I have a javascript link which clones the fieldset, so I get another batch of inputs to play with. Due to this, the calculations need to happen within the scope of each "fieldset.c alc"
The icing on the cake is that I need to grab the values of all the inputs on the page of a certain class, sum them up and display them inside a designated div. Something like getElementsbyCl assname perhaps?
I'm not really sure where to begin so any advice would be huge.
Thanks in advance,
PM
Comment