• Post Reply Bookmark Topic Watch Topic
  • New Topic

passing a hidden input as parameter

 
Devavrat Bagayat
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have two jsp's, 2 is called on clicking submit in 1.
Now I am passing a int as hidden input in jsp#1 and I want it in jsp#2 when the submit in jsp#1 is clicked. I have done all those connection, resultset etc. which is working fine with others. This is how i have done :-
this is in jsp#1
<%
int ie=0;
if(some condn which is true)
{
ie=1;
}
%>
<input type = "hidden" name = "Flg" value = "<%=ie%>" >
so I am getting the value of ie as 1, now in the jsp#2, I have done it this way :-
<%
String val = request.getParameter("Flg");
int ival = Integer.parseInt(val);
%>
But here the value of val i m getting is null.
What might be the reason ? or is that this just wont work ?
I am sending some other hidden inputs which are working absolutely fine.
 
Manohar Karamballi
Ranch Hand
Posts: 227
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where did u placed that hidden field declaration?
Is it inside form Tag?
Rgds
Manohar
 
Devavrat Bagayat
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, hidden declaration is in html.
I havent put it in jsp tags, even above u can c that i have closed that jsp tag.
 
Devavrat Bagayat
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well main thing I forgot it wasnt in the form tag. But this hint has helped me, its working now.
How dint I realise that, and what a stupid question I had asked, I had put 3 hidden declars in form n forgot for the above one.
Thanks for that.
[ January 17, 2002: Message edited by: Devavrat Bagayat ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!