aspose 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
 
wood burning stoves
 
subject: Is it possible to pass a value from JSP to Javascript
 
Similar Threads
passing value from javascript function to JSP
Javascript variable inside jsp scriplet
How to pass a value from a JSP to Javascript on the same page.
How to pass values between JSP - JSTL - Javascript ?
javascript passing value to JSP