fyogi1
05-17-2005, 07:49 PM
I want to build a single drop down menu that will execute a different action dependent on the option selected.
Here is what I have. We have numerical indicators for pieces of equipment. I have three types of equipment. I currently have three separate drop down menus. I have it set that way because the action in the form is pointed to a certain file. Here is my current code:
<form method="POST" action="file1.php">
<SELECT name="site" onChange="form.submit()">
<option></option>
--------------------------------
<form method="POST" action="file2.php">
<SELECT name="site" onChange="form.submit()">
<option></option>
--------------------
<form method="POST" action="file3.php">
<SELECT name="site" onChange="form.submit()">
<option></option>
I want to combine these three into one drop down menu because the options are all numbers. But only certain numbers can go to certain php file because I have three different tables in my database. Also the three different php files display different information.
Here is another way to explain it:
options 1-5 goes to action="file1.php"
options 6-10 and 20 goes to action="file2.php"
options 11, 15, and 34 goes to action="file3.php"
All in one single drop down menu.
I am not sure this is even possible. Also I don't know javascript.
Thanks in advance.
Here is what I have. We have numerical indicators for pieces of equipment. I have three types of equipment. I currently have three separate drop down menus. I have it set that way because the action in the form is pointed to a certain file. Here is my current code:
<form method="POST" action="file1.php">
<SELECT name="site" onChange="form.submit()">
<option></option>
--------------------------------
<form method="POST" action="file2.php">
<SELECT name="site" onChange="form.submit()">
<option></option>
--------------------
<form method="POST" action="file3.php">
<SELECT name="site" onChange="form.submit()">
<option></option>
I want to combine these three into one drop down menu because the options are all numbers. But only certain numbers can go to certain php file because I have three different tables in my database. Also the three different php files display different information.
Here is another way to explain it:
options 1-5 goes to action="file1.php"
options 6-10 and 20 goes to action="file2.php"
options 11, 15, and 34 goes to action="file3.php"
All in one single drop down menu.
I am not sure this is even possible. Also I don't know javascript.
Thanks in advance.