Code: Select all
<td><label>Job Status:
</label></td>
<td><select onkeydown="return noesc()" id="JobStatus1" name="jobStatus1" onchange="editStat(this)">
<option value="Please Select">Please Select</option>
<option value="Job Accepted <?php echo $datestamp;?>" >Job Accepted <?php echo $datestamp;?></option>
</select> <input type="button" style="width: 60px; height: 30px;" id="edit1" value="Edit" onclick="show('JobStatus');"/>
<input type="button" style="width: 60px; height: 30px;" id="hide1" value="Hide" onclick="hide('JobStatus');"/>
<input onkeydown="return noesc()" style="width: 255px;" type="text" name="jobStatus" id="JobStatus"></td>
</tr>When the Job Accepted option is selected it automatically gets passed to the jobStatus textbox to allow the user to edit the date and time if needed.
I am using the editStat() function to pass the value to the textbox here:
Code: Select all
function editStat(data)
{
document.getElementById("JobStatus").value = data.value;
}Many thanks