I've been in the jscript world for a while - I just wrote a calculation that functions like that. I believe if you use the onChange function, it will submit the results to whereever you need them. Or is it onPageload? I am not quite sure, go to google.com and search for onChange and see what others use the usage for. Goodluck
and as for the hidden part, just simply...
hahahahahahaha type=hidden name=whatevervar value=whatever>
Take it easy.