Need Help Passing Variables Using Post
I have a div on my page that is populated by a php calendar. The calendar also has month and year input fields so that the user can browse to different months. I would like to create a jquery function so that, when a user changes the month or year field, the div reloads the calendar and passes the selected month and year variable back to the php script. Here is what I have on my page:
-
<head>
<script type="text/javascript">
function startCalendar(month, year) {
$("#calendarDiv").load("calendar.php");
</script>
</head>
<body>
<div id="calendarDiv">
</div>
<script type="text/javascript">
startCalendar(0,0);
</script>
</body>
I can successfully pass the input value for the month and year to the function, but I don’t know how to pass those back to the PHP page when I reload the calendar. I’m assuming that I need to use $.post, but I just can’t figure out the syntax. Any help would be appreciated.