NogDog, thanks for the response! My concern isn't the selected line though, I can comment that out and the result is still the same.
I guess it would be worth it to try to add as much information as I can. After the above code is run (which just makes the drop-down menu), lower down on the page I have some html for the form fields:
<tr>
<td class="label">Status</td>
<td class="content"> <select name="cboOrderStatus" id="cboOrderStatus" class="box">
[code=php]<?php echo $orderOption; ?>
</select> <input name="btnModify" type="button" id="btnModify" value="Modify Status" class="box" onClick="modifyOrderStatus(
<?php echo $orderId; ?>
);"></td>
</tr>[/code]
modifyOrderStatus is a simple javascript that runs:
function modifyOrderStatus(orderId)
{
statusList = window.document.frmOrder.cboOrderStatus;
status = statusList.options[statusList.selectedIndex].value;
window.location.href = 'processOrder.php?action=modify&oid=' + orderId + '&status=' + status;
}
And ultimately, my processOrder function runs to modify the selected order:
function modifyOrder()
{
if (!isset($_GET['oid']) || (int)$_GET['oid'] == 0 || !isset($_GET['status']) || $_GET['status'] == '') {
header('Location: index.php');
}
$orderId = (int)$_GET['oid'];
$status = $_GET['status'];
$sql = "UPDATE tbl_order SET od_status = '$status', od_last_update = NOW() WHERE od_id = $orderId";
$result = dbQuery($sql);
$url = "index.php?view=list&status=" .$status;
header("Location: $url");
}
I am pretty sure that the problem either lies in the above post, or the modifyOrder PHP function.
Thanks!