Hi all,
How to pass the php date variable to javascript function. Here is the code I have tried out, but this is not recovering the date correctly in the javascript function
When I alert the date1 variable in javascript, it will give some junk value instead of date. How to get the date value into javascript variable
With regards
How to pass the php date variable to javascript function. Here is the code I have tried out, but this is not recovering the date correctly in the javascript function
Code:
<html> <script type="text/javascript"> function add($date1){ alert($date1) } </script> <body> <?php $date1 = date("y-m-d"); <input type="submit" value="GO" onclick="add('.date1.')"> ?> </body> </html>
With regards
Comment