i am trying to make a finish time in a line of text update depending on the length of time selected in the drop down box relative to the start time.
so if the start time was 13:00 and the user selects 1 hour the finish time would update to 14:00
I dont have a clue what i am doing right or wrong since i dont know the first thing about javascript.
<script type='text/javascript'>
function changeText(){
var option=document.getElementById('time').value;
if(option=='30'){
document.getElementById('field').value='".date(strtotime("$finishtime + 30 minutes"))."';
}
else if(option=='60'){
document.getElementById('field').value='".date(strtotime("$finishtime + 60 minutes"))."';
}
}
</script>
i dont seem to be getting any errors in the debugger and the script does nothing.
<a>Booking For ".$start." - </a><a id='field'>".$finishtime."</a><a> on ".$date."</a>
<form enctype='multipart/form-data' method='post'>
<a class='1'>Session Length</a>
<select name='time' id='time' onchange='changeText();'>
<option selected='selected'></option>
<option id='30' value='30'>30 mins</option>
<option id='60' value='60'>1 Hour</option>
</select>