Originally posted by Ted Dong:
When this form is submitted the jsp does some processing on the server. I want to set a result from the processing back into my javascipt variable myvar.
Remember, when the form is submitted it is a HTTP request. The server sends back the result page as the response. This is a whole new page! "Returning" a value from the JSP to JavaScript simply means initialising myvar to the value you want to "return":
I keep on quoting "return" because you're not returning values in the traditional sense. To the browser, it's really a whole new page and a whole new JavaScript program.
- Peter