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
  • Junilu Lacar
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Jj Roberts
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Himai Minh
  • Carey Brown
  • salvin francis

Jsp & JavaScript

 
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......
 
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
 
Marshal
Posts: 67478
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Report post to moderator
Please continue any discussion on your previous post on this same topic.
 
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic