Retrieve Hidden field value to another page

Retrive Hiddent field value to another page

Page 1 of 1

5 Replies - 7754 Views - Last Post: 08 December 2009 - 08:55 AM

#1 nasir_1823  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 07-December 09

Retrieve Hidden field value to another page

Posted 07 December 2009 - 12:16 AM

Hi!

I am getting problem while getting one form hidden value to another form.

Give me suggestion.
Is This A Good Question/Topic? 0
  • +

Replies To: Retrieve Hidden field value to another page

#2 Johnson-php  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 76
  • Joined: 14-November 09

Re: Retrieve Hidden field value to another page

Posted 07 December 2009 - 12:46 AM

Post your code here
Was This Post Helpful? 0
  • +
  • -

#3 nasir_1823  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 07-December 09

Re: Retrieve Hidden field value to another page

Posted 07 December 2009 - 01:12 AM

View PostJohnson-php, on 6 Dec, 2009 - 11:46 PM, said:

Post your code here



The First page: "f1.php"

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
<form name="hdf1" id="hdf1" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
<input name="ht" id="ht" type="hidden" value="testhidden" />


</form>
</body>
</html>



==============================
the second page: "f2.php"


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script type="text/javascript">
function hdn()
{

try
{
a = document.hdf1.ht.value;
}catch(err)
{
alert(err.message);
}
alert("new value:" +a);
alert("test");
}
</script>
</head>

<body onload="hdn();">


</body>
</html>
Was This Post Helpful? 0
  • +
  • -

#4 noorahmad  Icon User is offline

  • Untitled
  • member icon

Reputation: 209
  • View blog
  • Posts: 2,290
  • Joined: 12-March 09

Re: Retrieve Hidden field value to another page

Posted 07 December 2009 - 01:34 AM

check this tutorial about sending and retrieving data from Forms with PHP.
Get & Post Methods: How to & why.
Was This Post Helpful? 0
  • +
  • -

#5 trizz  Icon User is offline

  • New D.I.C Head
  • member icon

Reputation: 0
  • View blog
  • Posts: 22
  • Joined: 10-October 08

Re: Retrieve Hidden field value to another page

Posted 08 December 2009 - 08:50 AM

That's Javascript and not PHP. I suggest you take a look at the link noorahmad gave you.
Was This Post Helpful? 0
  • +
  • -

#6 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6075
  • View blog
  • Posts: 23,543
  • Joined: 23-August 08

Re: Retrieve Hidden field value to another page

Posted 08 December 2009 - 08:55 AM

Moved to Javascript.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1