X131044
Programmer
- Apr 20, 2008
- 3
I want to grab the client-side date and send it server side automatically without having to use any submit buttons. The routine exists and is working fine except it isn't automatically submitting the date/time. The submit button has to be pressed.
Here is the scenario. Every time an end-user adds a new record I want to grab the date from their machine and put it in to a display field, so that they can see it, and at the same time write that date/time away in PHP to a MySQL table. also not a problem.
I do not have a good understanding of JavaScript can anybody help?
Here is a snippet of coding at the point in question
clientdate=<?=$_REQUEST['Datum']?><br>
<form method="get" action="datetest.php" name="myform">
<!-- The line below sends the datetime upon form submit -->
<input type="hidden" name="clientdate" value="">
<input type="submit" OnClick="document.myform.clientdate.value=Datum;">
Here is the scenario. Every time an end-user adds a new record I want to grab the date from their machine and put it in to a display field, so that they can see it, and at the same time write that date/time away in PHP to a MySQL table. also not a problem.
I do not have a good understanding of JavaScript can anybody help?
Here is a snippet of coding at the point in question
clientdate=<?=$_REQUEST['Datum']?><br>
<form method="get" action="datetest.php" name="myform">
<!-- The line below sends the datetime upon form submit -->
<input type="hidden" name="clientdate" value="">
<input type="submit" OnClick="document.myform.clientdate.value=Datum;">