I have a form that when the person selects the date I want the value to go into a php function. I can view the value by using this.form.orderdate.value, but I want to put that value into the php variable $dateChosen
Here is the page so far:
TDM KML Generator 开发者_开发问答
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
<script type="text/javascript">DateInput('orderdate', true, 'YYMMDD')</script>
<input name="submit" type="submit" value="get KML" />
</form>
</body>
Javascript is all executing on the client machine, with the exception of an ajax call (which is still browser/client side and is making a request to a server-side function). PHP happens all server-side. In your case, you're trying to do something that isn't possible, because the PHP script is no longer executing by the time the page is rendered in the browser and the javascript is able to execute.
精彩评论