|
Passing variables from a dropdown box
Hello,
I'm trying to pass variables from a dropdown list in html into a javascript function and need help!
Basically, I have:
<form action="" onsubmit="create_record(<?=$_REQUEST['id']?>, <?=$_REQUEST['start_time']?>)">
<select name="start_time_hour" >
<? $GuideStartHour = date("G", $_REQUEST['start_time']);
for($i = $GuideStartHour; $i <= $GuideStartHour + 2; $i++): ?>
<option id="start_time_hour_<?=i?>"><? if($i < 10): ?>0<?=$i?><? else: ?><?=$i?><? endif; ?></option>
<? endfor; ?>
</select>
<input type="image" name="submit" src="../images/calendar_hover_button.png" value="Record this show">
</form>
$_REQUEST['id'] and $_REQUEST['start_time''] are 2 variables passed via the URL.
How can I get my function create_record in javascript to accept the dropdown values?!
Thanks
|