I have a web-page consisting of a listbox & image buttons. I want to post to the appropriate PHP script based on which list_item and image button combination is selected, where the logic is determined by JavaScript. So far, I can determine what list_item has been selected, but how do I determine what image button was selected?
The current PHP Script & JavaScript are below.
[HTML]<form method="post" action="operation_request_navigation.php" name="operation_navigation_form" onsubmit=
"return operation()";>
<div id="Layer17" align="center">
<table height="89">
<tr>
<td align="center">
<b>
<font size="2">New Operation</b>
<select name="operations_request_type" size="1" align="center">
<option selected="selected" >Select</option>
<option>Consultant</option>
<option>Client Account</option>
</select>
</td>
</tr>
</table>
</div>
<div id="Layer18">
<table width="272" height="150" border="0" cellpadding="0">
<tr>
<td width="89" height="67"> </td>
<td width="177"><input type="image" class="btn" id="Add" name="process_type" value="Add"
img src="images/Add.gif" alt="Add" width="126" height="37" /></td>
</tr>
<tr>
<td width="89"> </td>
<td width="177"><input type="image" class="btn" id="View" name="process_type" value="View"
img src="images/View.gif" alt="View" width="126" height="37" /></td></td>
</td>
</tr>
</table>
<table width="271" height="197" border="0" cellpadding="0">
<tr>
<td width="89"> </td>
<td width="176">
<a href="./logout_confirmation.php">
<img src="images/Logout.gif" alt="Logout" width="126" height="37" border="0"/></td>
</tr>
</table>
</div>
</form>
<script>
function operation() {
var f = window.document.forms.operation_navigation_form.el ements[0];
var g = f.options[0].selected;
var h = f.options[1].selected;
var i = f.options[2].selected;
if(g) {
alert("Please select an Operation");
return false;
}
if(h) {
location.href="./consulting_sr_form.php";
return true;
}
if(i) {
location.href="./operations.php";
return true;
}
}
</script>[/HTML]