Getting my date input to work?
Posted: Mon Mar 30, 2009 3:28 pm
Hello all, i have recently started to learn php and build and on-line web application and i am having a few difficulties.
The first problem that i have is that when i go onto my 'add job form' i cannot get my date pop up to appear? im not entirely sure but i think it may have something to do with the quotes around it as the javascript code is set in a php script?
Neither the start date or end date work...The textbox and image for the calendar which i click on appear but nothing happens when i click the mini calendar?
Any help would be greatly appreciated
The first problem that i have is that when i go onto my 'add job form' i cannot get my date pop up to appear? im not entirely sure but i think it may have something to do with the quotes around it as the javascript code is set in a php script?
Neither the start date or end date work...The textbox and image for the calendar which i click on appear but nothing happens when i click the mini calendar?
Code: Select all
<?
echo'<br/>
<div>
<p class="addjob">Add Job Form</p>
<form class="job_form" name="job_form" action="do_add_job.php" method="POST">
<table class="data">
<tr>
<td>Job Name</td>
<td>
<input type="text" id="job_name" name="job_name" size="20"></td>
<td ALIGN=CENTER>
<tr>
<td>Company Name</td>
<td>
<select name="Select Company Name">';
echo '<option value="">--Select Company Name--</option>';
while($opt = mysql_fetch_array($result))
{
echo '<option value="' . $opt['company_name'] . '"></option>';
}
echo'</select>
$num
<td id="fnamev" class="vn"></td>';
echo'<tr>
<td>Start Date</td>
<td>';
echo'<input type="text" id="start_date" name="start_date" size="10" )></input>
<a href="javascript:NewCssCal(\'start_date\',\'ddmmyyyy\')">
<img src="sample/images/cal.gif" width="16" height="16" alt="Pick a date"></a>';
echo'</td>
</tr>
<tr>
<td>End Date</td>
<td>
<input type="text" id="end_date" name="end_date" size="10" )></input>
<a href="javascript:NewCssCal(\'end_date\',\'ddmmyyyy\')">
<img src="sample/images/cal.gif" width="16" height="16" alt="Pick a date"></a>
</td>
</tr>
<tr>
<td>Contractor for this job</td>
<td>
<SELECT id="contractor" name="contractor" >
<option value="">--Select Contractor--</option>
<OPTION VALUE="james">James</OPTION>
<OPTION VALUE="james">John</OPTION>
<OPTION VALUE="jim">Jim</OPTION>
</SELECT>
</td>
</tr>
<tr>
<td>Contracted Hours</td>
<td>
<input type="text" id="contracted_hours" name="contracted_hours" size="5" ></input>
</td>
</tr>
<tr>
<td>Price</td>
<td>
<input type="text" id="job_price" name="job_price" size="10" ></input>
</td>
</tr>
<tr>
<td>VAT</td>
<td>
<input type="text" id="vat" name="vat" size="10" ></input>
</td>
</tr>
<tr>
<td>Status</td>
<td>
<SELECT id="job_status" name="job_status">
<option value="">--Select--</option>
<OPTION VALUE="ns">Not Started</OPTION>
<OPTION VALUE="o">Open</OPTION>
<OPTION VALUE="c">Completed</OPTION>
</SELECT>
</td>
</tr>
<tr>
<td>Cost of Job</td>
<td>
<input type="text" id="job_cost" name="job_cost" size="10" ></input>
</td>
</tr>
<tr>
<td>Job Created By</td>
<td>
<SELECT id="created_by" name="created_by">
<option value="">--Select--</option>
<OPTION VALUE="john">John</OPTION>
<OPTION VALUE="jim">Jim</OPTION>
<OPTION VALUE="james">James</OPTION>
</SELECT>
</td>
</tr>
<tr>
<td>Notes</td>
<td>
<TEXTAREA id="notes" name="notes" rows=4 size="110")></TEXTAREA>
</td>
</tr>
<tr>
<td>
<button type="submit1">SUBMIT</button>
<class="spacer">
<td>
</tr>
</table>
<br/>
</form>
</div>
<html>
<head>
<link href="forms_css.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="datetimepicker_css.js"></script>
<script type="text/javascript" src="jquery.js"></script>
</head>
<body>
</body>
</html>';
?>