This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
    Bookmark Topic Watch Topic
  • New Topic

Jsp & JavaScript

 
kanth varada
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Report post to moderator
hi

I want to set the value for the html hidden tag through Java Script and i want to use that hidden tag value in a jsp page.

i.e

<input type=hidden value=" " name="hid">

<script langauge="javascript">
//here i want to asign the value for the hidden input tag....

</script>

<%

//here i want to retreive the value into a variable....

%>


Pls send me the Stuff how can i do that.....
Pls send me a small example......
 
Shilpa Asuthkar
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Report post to moderator
hope this will help u.....

<html>
<head>
<script language="javascript">
function meth()
{
document.getElementById("t1").value="SHILPA";
}
</script>
</head>
<body>

<form name="myform" action="temp1.jsp" onSubmit="return meth()">
<input type="hidden" name="t1" value='<%=request.getParameter("t1") %>' >
<input type="submit" value="submit" >

</form>
<% String str=null;
if(request.getParameter("t1")!=null)
str=request.getParameter("t1");
%>
<%= str%>
</body>
</html>


cheerss,
Shilpa
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64708
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Report post to moderator
Please continue any discussion on your previous post on this same topic.
 
    Bookmark Topic Watch Topic
  • New Topic