• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

send variable

 
Bacchi Gerem
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
How can i send variable from javascript to jsp.


Thanks
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64721
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Author and ninkuma
Marshal
Pie
Posts: 64721
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.



This will append the value of a to the URL after properly encoding it.
 
Bacchi Gerem
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank You. I got it.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic