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:
Tim Cooke
Campbell Ritchie
paul wheaton
Ron McLeod
Devaka Cooray
Sheriffs:
Jeanne Boyarsky
Liutauras Vilda
Paul Clapham
Saloon Keepers:
Tim Holloway
Carey Brown
Piet Souris
Bartenders:
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 20 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 20 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 20 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 20 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: 67754
173
I like...
posted 20 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
See this topic
.
[
Asking smart questions
] [
About Bear
] [
Books by Bear
]
Consider Paul's
rocket mass heater
.
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...