2013-07-03 17:52


  • php
  • datetimepicker
  • jquery

I have a page with two forms on it. This shouldn't be a problem, but it is not working. My jquery looks like this:

            $("table.jobs tbody tr td#ejob").click(function()
                var $this = $(this);
                var col   = $this.text();
                var LeftCellText = $this.prev().text();
                if (col == '')
                alert("Please pick another column");
            var now = new Date();
            var month = now.getMonth()+1;
            var day = now.getDate();
            var year = now.getFullYear();
            if (month<10){month='0'+month}
            if (day<10){day='0'+day}
            var now = month +"/"+ day + "/" + year;

            var calendarBox = $('#calDate');
            var thisone = $('#calDate').val(calendarBox.datetimepicker('getDate'));

                minDate:('setDate', '' , new Date()),

                onSelect: function (selectedDateTime)
                    alert("Sendeing " + $('#calDate').val(calendarBox.datetimepicker('getDate')));

and my forms look like this:

echo "<form id='calendarForm' action='view_rev8.php' method='POST'>";
echo "<table border='0' width='100%'class='calendarTable'>";
echo "<tr><td align='left'>Click on a job number to update or change job information</td>";
echo "<td align='right'></td>";
echo '<td align="right">Calendar: <input type="text" id="calDate" size="15" name"calDate"/></td></tr>';
echo "</table>";
echo "</form>";
//creates the form to post jobid for updateJobForm.php
echo'<form id="jobUpdate" action="../forms/updateJobForm.php" method="post">';
echo'<input type="hidden" name="jobid" id="jobid">';
echo '</form>';

The first function handles when a user clicks on a table item and submits the post value without a problem. The datepicker works and the form gets submitted, but i get the following error: Undefined index: calDate from the following page:

$pickedDate = $_POST['calDate'];
echo $pickedDate;

$obj=new  jobs();
echo "<div style='border:solid 1px '>";
foreach ($obj as $val)
echo "<pre>";
echo print_r($obj);
//echo $obj->jobInfo();
echo "</pre>";
echo "</div>";

Why is this not working? It is a simple post from a well defined form, and as far as I can see all fields are named consistently and accurately.

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享