javascript form.submit() works again.

Set variables as a side effect, then submit when done.
This may become a general theme.
We really need to unwind the stack from whence javascript was called,
before we perform some of the side effects of the js script.