Calculating budget oninput rather than on submit