Bookmark Topic Watch Topic
  • New Topic

setting value for hidden tag

 
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......
[ February 15, 2006: Message edited by: Bear Bibeault ]
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65120
91
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Report post to moderator
kanth varad, this is the fifth topic you've posted with the title "Jsp & Javascript". This makes it impossible to tell them apart. Please read this for more information.

I've changed the title of this topic to something more approriate, please do so on your own in future posts.
 
Niki Nono
Ranch Hand
Posts: 256
  • Mark post as helpful
  • send pies
  • Report post to moderator
<%
String someVariable = "SomeValue";
%>

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

<script langauge="javascript">
//here i want to asign the value for the hidden input tag....
//Write whatever javascript you wish to write keeping in mind that is
//is going to execute at the client and not the server.
</script>

<%

//here i want to retreive the value into a variable....
//Not possible as you assign it in JSP which goes to client. Next the
//client will send back the value to some JSP again.
%>
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65120
91
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Report post to moderator
As Niki pointed out, what you are asking to do is impossible. Please read this article for details on why.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Report post to moderator
I've already tried to tell him twice yesterday but...
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65120
91
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Report post to moderator
Yes, you're right Satou. This isn't really much different a question than the one posted here, so I'm closing this topic.
 
    Bookmark Topic Watch Topic
  • New Topic