PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I am trying to pass a variable thru the POST method, and it does not seem to be working. I have Apache/PHP configured to use the $_POST method, because it works on other pages. Can anyone spot my error in the following code?
function getDates() {
var startdate = prompt ("Start Date (in Oracle Date format, DD-MMM-YY)","");
var enddate = prompt ("End Date (in Oracle Date format, DD-MMM-YY)","");
document.data.startDate.value = startdate;
document.data.endDate.value = enddate;
alert (document.data.endDate.value);
window.document.data.submit();
}
I am pretty sure it is getting the values from the prompt, but it does not seem to be passing them across the pages. I get null for both of the values on the recieveing page. Thanks
...
function getDates() {
var startdate = prompt ("Start Date (in Oracle Date format, DD-MMM-YY)","");
var enddate = prompt ("End Date (in Oracle Date format, DD-MMM-YY)","");
document.data.startDate.value = startdate;
document.data.endDate.value = enddate;
//alert (document.data.endDate.value);
//window.document.data.submit();
}
...
<FORM METHOD="POST" ACTION="tv/monday_report/weekly_tv_report.php" NAME="data">
<INPUT TYPE="text" NAME="startDate" VALUE="">
<INPUT TYPE="text" NAME="endDate" VALUE="">
...
server-side: write a html-form without any script and let php simply print_r($_REQUEST) and/or print_r($_POST)
edit: uhh, I see, someone was that clever, too and it didn't work out
Last edited by volka on Thu Aug 01, 2002 8:54 am, edited 2 times in total.
And it looks like it was just following the link rather than doing the submit() that I told it to in javascript. Does anyone know a way I can use normal text as a link to the javascript function that will then submit the form?