Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within JSP
Search Coderanch
Advance search
Google search
Register / Login
Forums
Register
Login
Java
»
JSP
send variable
Bacchi Gerem
,
Ranch Hand
Nov 27, 2007 12:23:00
(0 cow)
(0 skulls)
+Pie
Number of slices to send:
Send
Hi,
How can i send variable from javascript to
jsp
.
Thanks
Bear Bibeault
,
Sheriff
staff
Nov 27, 2007 12:31:00
(0 cow)
(0 skulls)
+Pie
Number of slices to send:
Send
That greatly depends upon what you mean by "send". Please
read this
.
Do you mean as part of a form submission?
Bacchi Gerem
,
Ranch Hand
Nov 27, 2007 12:53:00
(0 cow)
(0 skulls)
+Pie
Number of slices to send:
Send
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
,
Sheriff
staff
Nov 27, 2007 14:23:00
(0 cow)
(0 skulls)
+Pie
Number of slices to send:
Send
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.
Bacchi Gerem
,
Ranch Hand
Nov 27, 2007 14:33:00
(0 cow)
(0 skulls)
+Pie
Number of slices to send:
Send
Thank You. I got it.
Post by:
autobot
Hey, sticks and stones baby. And maybe a wee mention of my stuff:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
reply
This thread has been viewed 1071 times.
Similar Threads
jsp
design issue
hidden variable?
RequestDispatcher now working as expected
How to copy a portion of xsl into a variable
More...
All times above are in ranch (not your local) time.
The current ranch time is
Mar 19, 2024 00:46:43
.