Pass a value as hidden to PHP
| From: | Larry Sandwick | Date: | Fri, 03 Dec 2010 18:23:49 +0000 |
| Subject: | Pass a value as hidden to PHP | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-309842@lists.php.net to get a copy of this message | ||
Wrong file sent the first time... this one has the right file
How do I get the document.tstest.timestamp.value from the JS and pass it as
a hidden value using a $var to the resultsHistory.php page ?
See the code listed below, any help would be appreciated !
[snip]
<html>
<title> Get History </title>
<head>
<script language="JavaScript" src="ts_picker.js"> </script>
</head>
<body>
<?php
$company = $_GET['customer'];
$mpad = $_GET['rep'];
$rep = ( $mpad / 9112001);
?>
<center>
<h1> Company History </h1>
<table width=600 border=0><tr><td>
<form name="tstest" method="post"
action="http:resultsHistory.php?h_date="timestamp;
target=_blank>
Enter Starting Date :
</td><td height=100>
<input type="Text" name="timestamp" value="">
<a href="javascript:show_calendar('document.tstest.timestamp',
document.tstest.timestamp.value);"><img src="cal.gif" width="16"
height="16"
border="0" alt="Click Here to Pick up the timestamp"></a>
<tr><td height=100>
Enter Company:
</td><td>
<input type="Text" Name="rep" Value="<? echo $mpad ?>">
<input type="Text" Name="company" Value="<? echo $company
?>">
<tr><td>
</td><td align=right>
<?php
echo "<input type='hidden' name='h_company' value='$company'
/>";
echo "<input type='hidden' name='h_mpad' value='$mpad'
/>";
?>
<input type="Submit" Name=Submit" Value="Get History">
</form>
</td></tr></table>
</center>
</body>
</html>
[/snip]
// Larry
252.291.1414 x223
-----Original Message-----
From: parasane@gmail.com [mailto:parasane@gmail.com] On Behalf Of Daniel P.
Brown
Sent: Friday, December 03, 2010 12:18 PM
To: Larry Sandwick
Cc: php-general@lists.php.net
Subject: Re: [PHP] Pass a value as hidden to PHP
On Fri, Dec 3, 2010 at 12:12, Larry Sandwick <lgs@sarreid.com> wrote:
> How do I get the document.tstest.timestamp.value from the JS and pass it
as
> a hidden value on the resultsHistory.php page ?
[snip!]
There are tons of issues with that code, but not one bit of it has
to do with PHP. You should ask on a newbie HTML list or a JavaScript
mailing list.
--
</Daniel P. Brown>
Dedicated Servers, Cloud and Cloud Hybrid Solutions, VPS, Hosting
(866-) 725-4321
http://www.parasane.net/