@thanzaw,
You should be more specific, for example can you use a link with an onclick event instead of a button? That would seem pointless as a test question but that's one option.
You already have onblur events so you know about those and probably know about onfocus, there is also onchange you can use (e.g. put it on all of the inputs and make the script calculate each time any value is changed).