Page 1 of 1

html drop down list, edit selected values

Posted: Fri Nov 01, 2013 7:48 am
by sectionLeader123
In the following code I have a drop down list with a date/time stamp echoed inside the list. The date/time stamp is defaulted to that particular days date and time. But what I would like to do is say when I select the job accepted option in the list I want to be able to edit the date and the time by simply clicking on it and then key in the desired date or time.
Any help would be greatly appreciated thanks:

Code: Select all

<?php
date_default_timezone_set('Europe/London');
$datestamp = date('d/m/Y h:i:s a', time());
?>
<html>
<head>
</head>
<body>
<select id="status"> 
<option value="Please Select">Please Select</option>
<option value="Job Accepted <?php echo $datestamp;?>" >Job Accepted <?php echo $datestamp;?></option>
</select>
</body>
</html>

Re: html drop down list, edit selected values

Posted: Fri Nov 01, 2013 2:50 pm
by Christopher
If you want to edit the date, then I assume that it is stored somewhere. So attempt to load the stored date. If the stored date exists, then set $datestamp to the stored value. If it does not exist, then set it to the current date.

Re: html drop down list, edit selected values

Posted: Mon Nov 04, 2013 3:43 am
by sectionLeader123
Appreciate the input Christopher but I am going to pass the value from the drop down list to a textbox and edit the date there. Seems to be easiest way to do it. Many thanks.