posted 17 years ago
Well, it depends on what you want. In your case value will not be calculated until the field you change actually looses focus. If this is ok, you can use onblur or onchange.
Otherwise, your options are:
1. onkeyup or onkeypress (you will need to comeup with some way to handle cut/paste)
2. setInterval - recalculate the value every time interval
3. more fancy setTimeout - onfocus will initiate timeout to recalculate the value, each keypress will cancel previous timeout and start a new one.