File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes Is it possible to pass a value from JSP to Javascript Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Reply locked New topic
Author

Is it possible to pass a value from JSP to Javascript

Ramesh Shanmugam
Ranch Hand

Joined: Sep 13, 2004
Posts: 132
I have a JSP page, in which i need to pass a Value of a Text box to a Javascript.
IS it possible to do so.


Ramesh Shanmugam - SCJP 1.5
Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
You can write the value that's known during HTML generation to the Javascript using JSP code before the HTML is sent to the client.
You can use Javascript to read the actual value at the client at any time, read a Javascript book.

How often must we repeat: JSP is SERVERside code, Javascript is CLIENTside code. They can NOT interact during execution.


42
Anil Kumar Saha
Ranch Hand

Joined: Apr 07, 2004
Posts: 111
Here is an example



Regards,

Anil Kumar Saha
SCJP 1.4
http://www.agilej.blogspot.com/
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Please do not cross post: http://www.coderanch.com/t/115191/HTML-JavaScript/pass-value-JSP-Javascript-same

Eric
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Is it possible to pass a value from JSP to Javascript