FAQs
Search
Recent Topics
Flagged Topics
Hot Topics
Best Topics
Register / Login
Win a copy of
Mastering Corda: Blockchain for Java Developers
this week in the
Cloud/Virtualization
forum!
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
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Paul Clapham
Ron McLeod
Bear Bibeault
Liutauras Vilda
Sheriffs:
Jeanne Boyarsky
Tim Cooke
Junilu Lacar
Saloon Keepers:
Tim Moores
Tim Holloway
Stephan van Hulst
Jj Roberts
Carey Brown
Bartenders:
salvin francis
Frits Walraven
Piet Souris
Forum:
JSP
send variable
Bacchi Gerem
Ranch Hand
Posts: 120
posted 13 years ago
Hi,
How can i send variable from javascript to
jsp
.
Thanks
Bear Bibeault
Marshal
Posts: 67496
173
I like...
posted 13 years ago
That greatly depends upon what you mean by "send". Please
read this
.
Do you mean as part of a form submission?
[
Asking smart questions
] [
About Bear
] [
Books by Bear
]
Bacchi Gerem
Ranch Hand
Posts: 120
posted 13 years ago
How can i send variable a to jsp page :
code :
function callEdit(key)
{
var a = document.user.tempId.value=key;
alert(a);
document.user.action="http://localhost:8084/Struts_Contract_Entry/jsp/mysql.jsp?edit=a"
document.user.submit();
}
Thanks
Bear Bibeault
Marshal
Posts: 67496
173
I like...
posted 13 years ago
Ah, you want to send it as a request parameter on the query
string
. This is the sort of detail that should have been provided in the first post.
document.user.action="http://localhost:8084/Struts_Contract_Entry/jsp/mysql.jsp?edit=" + encodeURIComponent(a);
This will append the value of a to the URL after properly encoding it.
[
Asking smart questions
] [
About Bear
] [
Books by Bear
]
Bacchi Gerem
Ranch Hand
Posts: 120
posted 13 years ago
Thank You. I got it.
This guy is skipping without a rope. At least, that's what this tiny ad said:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
jsp
design issue
hidden variable?
RequestDispatcher now working as expected
How to copy a portion of xsl into a variable
More...