Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within HTML Pages with CSS and JavaScript
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Ron McLeod
Paul Clapham
Tim Cooke
Devaka Cooray
Sheriffs:
Liutauras Vilda
paul wheaton
Rob Spoor
Saloon Keepers:
Tim Moores
Stephan van Hulst
Tim Holloway
Piet Souris
Mikalai Zaikin
Bartenders:
Carey Brown
Roland Mueller
Forum:
HTML Pages with CSS and JavaScript
How to pass a value from a JSP to Javascript on the same page.
Ramesh Shanmugam
Ranch Hand
Posts: 132
posted 19 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
How to pass a value from a
JSP
to Javascript on the same page.
Ramesh Shanmugam - SCJP 1.5
Eric Pascarello
author
Posts: 15385
6
posted 19 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
On the server side, you need to write out the JavaScript that holds that information. Only way for JavaScript to get the info.
Eric
Ramaswamy Srinivasan
Ranch Hand
Posts: 295
posted 19 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi Eric,
A clarification needed here.....
Can't it be done in the client side itself? Do we really need to do it the .js at the server side?
Is there no way like var
var varInJS = document.forms[].someField.value
Might sound silly, but to know that...
Cheers,
Swamy.
Eric Pascarello
author
Posts: 15385
6
posted 19 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Only way for the JSP to pass the value to the page is to dynamically write it to the page. It can be placed in a text field or written to a varaible, or place it in a cookie. There is really no other way to do it then those ways.
Eric
Bear Bibeault
Sheriff
Posts: 67750
173
I like...
posted 19 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
See this topic
.
[
Asking smart questions
] [
About Bear
] [
Books by Bear
]
eat bricks! HA! And here's another one! And a tiny ad!
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
How to fetch value from Text box of JSP page
RunTime passing value Jsp
Hidden fields in Javascript
How do you set a javascript variable from jsp?
global variables in Javascript
More...