Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HTML Hidden value

 
Meet Gaurav
Ranch Hand
Posts: 492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I have 2 HTML pages and I need to pass some values using hidden fields. But don't know how to get that values on the next page. Please assist me
 
Birla Murugesan
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
please say clearly what you are doing
 
Meet Gaurav
Ranch Hand
Posts: 492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have the hidden on the first page

<input type="hidden" name="a1" value="b1">

On the second page I need the value of a1. How to retrive that.
 
Birla Murugesan
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

how can you are redirecting first html to second one
 
Birla Murugesan
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Have an id for input field
<input type="hidden" name="a1" id="new" value="b1">

here is the code

<script>
var new = document.getElementById("new").value
window.location="http:/adbcd.com?new="+new;

<script>
 
Meet Gaurav
Ranch Hand
Posts: 492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is the get method. How about post method ?
 
Birla Murugesan
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

how you are redirecting by post method?

give a code snippet
 
Meet Gaurav
Ranch Hand
Posts: 492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
After hitting the submit button

<FORM NAME="CityChoice" METHOD="post" ACTION="ss.html">
 
Birla Murugesan
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I think ,there is no possibility of getting parameter in post method.

let me know why you are redirect one html to another,Anyhow you don't get dynamic content in htmls,

then what is the use of this,it's worthless,

so you combine both into one,you can do whatever you want using javascript and Dom model
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Post would require you to use a serverside language to get at the data. For clientside only you need to use a get.

Eric
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic