Hacking A Little Javascript
I’ve been having fun over the weekend hacking some javascript. I needed something that would auto summarize some form fields and then pass the total along to another page. Enter formtotal: http://github.com/lance/formtotal
Usage
Add this to your HTML file:
<script type=”text/javascript” src=”scripts/mootools.js” charset=”utf-8”></script>
<script type=”text/javascript” src=”scripts/formtotal.js” charset=”utf-8”></script>
Give the fields you want to have added up a class name of ‘addend’. Add a ‘total’ field, and you’re done. Simple - but it’s fun hacking JS.