I have a page (parent) that when a button (with .click funciton) is clicked it uses jQuery .load to load a form into the div. On the parent page is the following PHP
<?php
$SubmitDATETIME = date("n/j/Y g:i A");
$timestamp = date ("n/Y");
?>
the "loaded" content uses a remote script to validate the form, but I cannot seem to pass the $SubmitDATETIME and $timestamp to the loaded form. I've tried just using input boxes like
<input type"text" value="<?php echo $SubmitDATETIME ?>"> but they are empty. When I put same code on parent page it works. Should I a) create this function with JS and apply to the button's click funciton, or b)is there a way to pass the $SubmitDATETIME and $timestamp variables from the parent page to the loaded content? possibly make it a remote PHP function and use .get to echo the values? I'm stumped.
thx
***************** EDIT *****************
I might not have been as clear as I needed to be on this, when you click the "button" it invokes a click function $("#singleContent").load('pForm.php #formContent', function() {...}); inside the function is the validation for the form, which contains the submtiHandler. In the submitHandler is a function to build an xml string of all the values of the form. One of which was to "echo the submitDATETIME" php function. this is where i was having issues. When I included the function as a $_SESSION, i could get it to print to the loaded form, but the validation was not echoing it. I know that I could use JS to build the funciton in the validation, but I don't know how. I was able to echo the submitDATETIME to a hidden input and get it's value from that in the xml string. phew. Is there a better way? how would I build the datetime with JS?