473,387 Members | 3,033 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Combination 'list_item' & 'image_button' PHP/JavaScript

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">&nbsp;</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">&nbsp;</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">&nbsp;</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]
Sep 14 '06 #1
1 1731
acoder
16,027 Expert Mod 8TB
Add on onclick to each button to send the user to the corresponding page.
May 13 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Luklrc | last post by:
Hi, I'm having to create a querysting with javascript. My problem is that javscript turns the "&" characher into "&amp;" when it gets used as a querystring in the url EG: ...
4
by: johkar | last post by:
When the output method is set to xml, even though I have CDATA around my JavaScript, the operaters of && and < are converted to XML character entities which causes errors in my JavaScript. I know...
3
by: Nathan Sokalski | last post by:
I have a VB.NET function that I am using in an ASP.NET page. The code creates a String, which contains && (the JavaScript Logical AND operator) and is used as part of the JavaScript sent to the...
8
by: Nathan Sokalski | last post by:
I add a JavaScript event handler to some of my Webcontrols using the Attributes.Add() method as follows: Dim jscode as String = "return (event.keyCode>=65&&event.keyCode<=90);"...
14
by: Arne | last post by:
A lot of Firefox users I know, says they have problems with validation where the ampersand sign has to be written as &amp; to be valid. I don't have Firefox my self and don't wont to install it only...
12
by: InvalidLastName | last post by:
We have been used XslTransform. .NET 1.1, for transform XML document, Dataset with xsl to HTML. Some of these html contents contain javascript and links. For example: // javascript if (a &gt; b)...
3
by: Nathan Sokalski | last post by:
I am adding an onmouseover attribute using the Attributes.Add() method, and the String I am using for the value contains the & character. However, when rendered the & is converted to the HTML...
19
by: viki1967 | last post by:
Hi all. I should work this control with javascript: First select: 1) Frank 2) Anthony 3) Max 4) Mark 5) Vincent
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.