You can use nuSetHash() to set a Hash variable that will carry through to the next Form or PHP code you want to run.
nuSetHash('newTotal', document.getElementById('newTotal').value); //-- javascript
print 'The new Total is : #newTotal#'; //-- php