dcsimg
assigning javascript variable to a jsp variable
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Shekar_Atmakur
Posted On:   Monday, January 21, 2002 07:27 PM

hi,
how can i assign a the return of a javascript function to a jsp variable?


thanks

shekar

Re: assigning javascript variable to a jsp variable

Posted By:   Dhiren_Bhatia  
Posted On:   Monday, January 21, 2002 09:44 PM

what you have to do is assign the value of the javascript function return to a hidden field in a form and then post the form to the jsp page.

retrieve the value in the jsp and assign it to the desired variable in the JSP.

Note that the JSP is equivalent to a servlet running on the web-tier of your application and thus, data from the browser side (JavaScript) will have to be posted (or you could send it in a GET request) to the servlet/JSP.

Dhiren

About | Sitemap | Contact