Re: Pass a value as hidden to PHP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 2010-12-03 at 13:23 -0500, Larry Sandwick wrote:
> 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>
>    &nbsp;  
> </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

do you expect this code to work?   because i see a lot of fail in this
code.

What it seems like you need to know, is how to get the javascript popup
calendar, to return the selected date back to the calling page... yes?

if so, then you need to read the documentation on the calendar that
you're using.   this is not a PHP related question as far as I can see.

if you need an answer to your question, then to pass a hidden value back
to php, then you should already know your answer as you have <input
type="hidden" /> in there already... 

my suggestion is still, read the documentation for the javascript
calendar, and email them your question on how to get it to return the
value, as this doesn't look at all like a php related problem/issue, and
we dont know what the javascript looks like/does.

I think Daniel said it best... "You should ask on a newbie HTML list or
a JavaScript mailing list."

Steve


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux