| Author |
how to store a js value in a java or jsp variable
|
hashmukh punamia
Greenhorn
Joined: Aug 14, 2007
Posts: 22
|
|
HI Ranchers, I have an javascript function in a jsp file function encodeTxt(s){ ............ ......... } I want to assign the return value of this function to a java variable. How is it possible. I have one method but dont know how efficient it would be, I try assigning return value of a js function to a form object say textbox and then use request.getParameter to retrieve the value in java. Thanks & Regards, Hashmukh
|
 |
Ben Souther
Sheriff
Joined: Dec 11, 2004
Posts: 13410
|
|
That is the correct way to do it. Remember, Javascript and HTML are both interpreted on the client's machine after all of the JSP code has already been run on the server. The two do not ever directly interact.
|
Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
|
 |
 |
|
|
subject: how to store a js value in a java or jsp variable
|
|
|