Or perhaps you could have a hidden frame that is refreshed with the javascript onchange. The hidden frame could be a php page, could have it's parameters passed in the url and write out a piece of javascript that changes a variable or form field in the main frame. All technically possible if you don't mind the frames, but I've never done it in practice, it might be too slow for your needs.
Hope that helps