Win a copy of The Java Performance Companion this week in the Performance forum!
    Bookmark Topic Watch Topic
  • New Topic

Is it possible to pass a value from JSP to Javascript

 
Ramesh Shanmugam
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
  • Report post to moderator
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.
 
Jeroen Wenting
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
  • Report post to moderator
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.
 
Anil Kumar Saha
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
  • Report post to moderator
Here is an example

 
Eric Pascarello
author
Rancher
Posts: 15385
6
 
    Bookmark Topic Watch Topic
  • New Topic