Drop Down Lists Changing Depending On Other Drop Downs
I want to have a drop down system like this one. But without the radio buttons.
I want to have 3 drop downs but have no idea how to go about it. I assume I will need to activate some sort of Javascript on the onChange event of the option drop downs.
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Drop Downs
trying to get dropdowns to appear and getting no where! I have a script with a config file that has a list of options. I have added a list of ages like so: $age[0]= 18; $age[1]= 19; $age[2]= 20; I now want to include these in a page in a drop down menu and have tried this code : $ageshow .= "<option>$age</option>"; echo "<tr bgcolor =$bg2>"; echo "<td class="classadd1"><div class="maininputleft">Age:</div></td>"; echo "<td class="classadd2"><select name="in[sfield]">"; echo "$ageshow</select> "; echo "</td>"; echo "</tr>"; this does not list the ages but just has array in the drop down. What am I doing wrong?
Dependent Drop Downs?
I have a drop down menu populated from a database. There are 3 other drop downs on the page that I want to populate from the database AFTER the user has made a selection in the first list. Can that be done? Are there any scripts for that anywhere?
PHP 4.3.4 Upgrade ... Need Help With Drop Downs
I upgraded from PHP 4.1.2 to 4.3.4 (Mac OS X 10.2.8), and then had to adjust all of my form scripts to retrieve the POST variables explicitly (because 4.3.4 requires this). I did this like the following: <input type=text name=myinputbox> <input type=submit name=submit value=submit> ------- $myinputbox = $_POST[''myinputbox]; $submit = $_POST['submit']; That works just fine, and the variable data is available for use elsewhere in the script. Radio buttons and textareas also work in this way. However, my problem is that <SELECT> drop down menus apparently DO NOT work in this way. This renders my form useless without this ability. If you can post a reply code for retrieving the <SELECT> POST variable to the following code, I would appreciate it. <SELECT name="MENU"> <option>option1</option> <option>option2</option> <option>option3</option> </SELECT> I assumed it would be this (but didn't work): $MENU = $_POST['MENU']; Hope I am clear with my explanation.
Two Different Drop Downs From MySQL
I have a admin area for a website, and on some part the admin can select options from two different drop down boxes. Now i thought that it would be better to use one Query for both dropdowns. How can i get them together? I now have something similair twice: <select name="series_id" class="dropdownbox" id="series_id"> <option value="0">- select -</option> <?php $db = mysql_connect("localhost", "name", "pass"); mysql_select_db("db_name"); $result = mysql_query("SELECT * FROM series ORDER BY name"); if ($data = mysql_fetch_array($result)){ do { $current_id = $data['series_id']; if($current_id == $id){$selected = "selected";}; echo "<option value="".$data['series_id']."" ".$selected.">".ucfirst($data['name'])."</option> "; } while ($data = mysql_fetch_array($result)); } else { echo ""; }; mysql_close($db);?> </select> I hope it's clear what i mean. I do not make connection twice, but the rest is similair except for the tablename of course.
Dynamic Associated Drop Downs
I wrote a function to pull country values from my MySQL database into my forms country drop down list. This works great. However, I want to also pull region/state data for my form's region drop down list whenever a country is selected/changed in the country form field. I know I can do this with javascript but I want to do it with PHP only. Can I do like a onclick command on the country field and have it resubmit the query that populated the region field? I think this is possibe but not sure how to do it.
Arrays, Drop Downs & Includes ...
I am setting up a classifieds site using a script bought in. set about hacking a few bits & pieces that I did not like, the script has mainly text fields but I wanted drop downs. I copied the way countries were populated using an include file & replicated 10 times, i read somewhere that multiple includes in a script can slow things immensely is this so? The code:
Dynamic Drop Downs With Php And Java
I'm working on a project where I need the drop down menus to be dynamic almost identical. I found a java code that looks to do what I want it to do. But, being that I know very little about this, I'm not sure what goes where.
Calculate Values From Drop Downs
I've been trying to get this to work myself all day long before posting here. I want to create an order form which includes 2 drop down menus, StartLength and EndLength, the menu options for both being: 0-10 min 10-30 min 30-60 min The respective values for each option are: 25 50 100 (the user should not see these values.) The total cost will be displayed and will be the average of the two values. I've tried several different things, and nothing has really worked. Here is the code I have at the moment.. Code:
Auto Populating Multiple Drop Downs.
im trying to create two dropdowns, i need the first one to be the category and the second one to be the subcategory. The category drop down autopopulates with the correct info from the database. and uses the table "category", the value of each drop down is represented by the "cat" field in the table (cat is basically and integer id number) and "Category" is used as what the user actually sees in the drop down (category is the actual word of the category). Once the category is selected i would like to have the sub category auto populate with everything that has the same values as the selected category (cat) Here is a break down of how the tables work. Table 1 Name: "category" Fields for Table 1: "cat" (the id number), "category" ( the actual name of the category) Table 2 Name: "subcategory" Fields for Table 2: "cat" (corresponds with the cat id from table 1 to pull the correct data), "subc" (the basic id of the subcategory), "subcat" the actual name of the subcategory. so the way i see it, have a normal drop down populated by a php query. then on change, populate subcategory drop down where cat = cat and display sub category.
Drop Down Lists
I have a drop down list with the town options 'Bury' and 'Ipswich' as shown below. When selecting one of the options, its value is passed to variable $townsearch. How do I change the drop down list so the option selected last time is then the current one shown in the drop down box? <body> <?php $townsearch = $_get['town']; ?> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="get"> <select size="1" name="town"> <option>ipswich</option> <option>bury</option> </select> <input type="submit" value="GO" /> </form>
Drop Down Lists And Variables
I have a dropdown list with values and I am having trouble getting the value chosen into a variable so that I can use it in an if statement.
Sending An Email Depending On Drop Down
I'm trying to create a form with two drop down menus, (both populated from mysql databases). One of the databases has user names in it. The other has managers in it + their email addresses. The idea is that the user chooses their name and the name of the manager they will be working for and it then sends an email to the relevant manager telling them that the user's name and what time they have logged on. I've worked out how to populate the drop down menus from the database, and how to send the time and name via email. Unfortunately I haven't worked out how to tie them together or how to send to the different email addresses. I've been staring at the code so long it now looks like gibberish. Code:
Saving Selection In Drop-down Lists In PHP After Page Reload?
I can't find an answer to my quesiton anywhere. Given a drop-down list with USA states and other text fields I pass this information for further processing via PHP. If any of the required fields is empty, the PHP script would return an error and reload the form page asking to fill out those fields. All entered information is saved... except for the drop-down list selection. I tried to write a Javascript function which is echoed by PHP, but interpolation of PHP variables in the Javascript section gives a syntax error message in Javascript. The PHP script returns, e.g., an "AL" string for Alabama. Of course, I don't want to write PHP code for each option to make it selected.
Auto Changing Link Depending On Date
I want to have a special link on my site. The link is to a text file located on a distributor's website and is named with a specific filename in the same format every week. In other words it's guaranteed predictable. Here is what the file would look like, shipping_032107.txt which means, shipping_(month)(day)(year).txt How could I use something to make the link the right name without modifying my page weekly? The one tricky part is that it's updated once a week and it would be Wednesdays date each time. So it actually has to predict the next date. Perhaps if the script couldn't do that it could figure out todays date, check it to the days of the week and add a number to equal the proper day, I have no idea what to start with for this.
Drop Down Box
I have a drop down box that I have coded to have several values. These values are actually snippets for SQL code. how do I make the drop down box display the selection picked by the user after the page is refreshed?
Drop-down X 5
I am trying to populate a drop-down from a database and repeat this drop-down five times. The first drop-down gets populated but the others don't. I tried to reset the array, but I am still new to PHP and not sure if I am doing correct. Code:
Drop Down Box
The purpose of this application: I need 2 combo boxes, one with months, and one with years. When the user chooses both a month and a year, a page is displayed with certain numbers that are retrieved from a database. Those numbers correspond to the specific month and year. For example, January 1998 produce "12", but February 2001 might display "73". So I guess I'm asking 2 questions. The first is just a general outline of how someone might go about doing this (to see if i'm on the right track in my thinking). The second, and more important question is for someone to please explain to me how do I get the values chosen in the drop down boxes to correspond to specifc fields in a database?
Drop Down Box
i've got a drop down box that is populated by the results of a mysql querie but for some reason it only shows the first word. so if i have the results; test 1 test 2 test 3 it will just display test, Code:
Drop Down Box Other
Im trying to create a drop down box which at the end has a Other option. If Other is selected I want the variable which is set from the drop down box to be set to whatever is typed in, in the input box below by the user e.g: <select name="team_name"><option value='' selected disabled>Select Team Name</option> <option value="1st XI">1st XI</option> <option value="2nd XI">2nd XI</option> <option value="3rd XI">3rd XI</option> <option value="Other>Other</option> </select> I dont really want to use Java or AJAX, is there anyway in which this can still be done?
Drop Down Box
I have a couple of drop down boxes which you select the option you want, that value is then stored in the database. If you make a mistake there is an edit option which once clicked shows the form with the information filled in/selected. However my problem is that when you edit, although the current option which was previously entered into the drop down box is set as the starting value, which is disabled, if you dont change the drop down box the value is deleted rather than held as it hasnt changed. Code:
One Drop Down Box Effecting Another.
I am trying to have one drop down box effected by another drop down box on one page only. I would like a user to select their state from a drop down box, then depending on what state they choose, I would like the list of cities from another drop down box to be displayed that are linked to that state in a mysql database. The purpose is to keep the list of cities to choose from small, they should not have to waid through a list which contains cities in other states.
Drop Down List
I want to read a directory for available files and then get the filenames and put them in a drop down list. Whatever the user will select will be the value of the variable $selected. I already found the code to read directories: Code:
Selecting From A Drop Down Box
I have a drop down box populated with names of towns from my db (MySQL) all that is working fine. My problem is I do not know how I select a town in the box and have it take me to that web page on my site.
Drop Down Menu(add Cat)
I have DB to add category and forum to edit the terms that in the cat so I add this code in the edit forum to change the cat of the term by choose the cat from drop down menu PHP Code:
How To Get Value From Drop Down Box To E-mail With Php
I have a form that includes a drop down box. I can get all of the other values to show up in an e-mail except for the drop down box values. Can someone please help? -- I know the HTML isn't the greatest. The website was originally created in FrontPage and the form broke. I'm just trying to help out and fix it for a friend. sendmail.php ....
PHP And Drop Down Menus
I've looked through the forum rather extensively and my qestion is similiar to the question by Brian_F and answer by "saintaw" a couple of days ago in this forum. I already have a functional page that has several dynamic drop-down menus from which the user selects a topic of interest. My question is how to reference their choice from the drop down menus in order to display the results of their choice. I would like the user to be able to choose a subcategory with one of the drop down menus and then be able to view the questions related to that subcategory. I currently have a nested for loop which displays the categories and subsequent drop-down menus for each category, and I'm using PHP and MySQL to do the dirty work. code:
Php And Drop Down List
I am coding an email form on a site. A user enters their name and contact email and then selects from a drop down list to which particular email the message should be sent: User1, User2, User3. Then the user types out a message and hits submit. My problem is that I am unsure as to how to grab the selection in the drop down list and pull the selection and place it like this: "$selection@domain.com". Here is the php code:
Drop Down Menu
I have a page that uses php to look up specific fields in a specific table of a specific database based on the username. Using this, it creates a dropdown list of information belonging to that user. The fields in question each have 13 pieces of data. Based on what they click in the dropdown box, I need that specific data to pass onto hidden fields on the page. Code:
PHP-MySQL Drop-Down Box
I'm using PHP to dynamically make a drop down box of users in a table. The first row is displayed with all the users. However, on the second row non of the users are listed in the drop down box. It only works on the first.
Drop Down Menu
I'm struggling to get this to work. It is suppose to show only $name and not $name and $email PHP Code:
Drop Down Menu
I am implementing a website with dreamweaver. I dont know much about programming but I can handle scripts and manupilate. does anyone know a website that i can get a free drop down menu script to use on the website's navigation?
Drop Down Menu
I have 2 drop down boxes on my site. I want the selection of the first one to populate the second box.
Extended Drop Down
I've picked up some scripts from this forum regarding drop down lists (thanx!), and now I'm wondering if anyone can explain to me how to do the following: Table: +---+-----+ |ID |NAME | +---+-----+ |1 |name1| |2 |name2| |3 |name3| +---+-----+ I fetch values from NAME to a drop down list without problems. Then I want to select the corresponding ID (depending on which NAME-value I've selected) into a hidden(?) field to use later on in a submit.php page which is sent to another table in the db.
Drop Down Menu
What i would like to do is look in a file and see what the name's of the files are in there and have them put in to a drop down menu. Dose some one know of a tutorial on this or how to do it?
Drop Down Menu
I have a problem with a drop down menu, I have 2 drop down menu's if 1 select in dropdown menu 1 a catagorie then I must give this to menu 2 and then there must be things in menu to with catagorie from menu 1 I just want when I clicked menu 1 the php file refreshed en gives the catagorie with the refreshed file but HOW?
Php And Drop Down Menus
I have a question about PHP and drop down menus. Should I be using PHP for my drop down menus or should I be using java script? I have a whole contact form that is programmed in PHP, but I have never done a drop down menu with PHP, is this possible? If anyone knows of any great drop down menu tutorials in PHP.
Drop Down Filter
I've got two drop down menus that I'm using to filter some data. It works when the user selects an option from both menus but always return ZERO records when only one of out the two menus have been set. My code POSTS the ID from each menu then puts that ID into the WHERE clause of an SQL query. Code:
Drop Down Select
I am working on a small script to load all members names into a drop down list, this I have acheived so far. What i'm looking to do is make this so that when I select a name from the list I have a submit button which opens up a member edit form which I have created. Code:
Drop Down Menu?
Im looking for a script for a site im making that will make a drop down menu which I can customise the color of. Simple, like a border and background color, but is friendly with all types of IE explorer.
Drop Down Box To A List Box
i have this drop down box that displays the relevant info from the table that its loading. But the drop down box isn't quite so wise to use if there hundreds of rows. So what i wanted to do was change it to a list box instead ... would any one know how to do that? Code:
Auto Drop Down Box
I need to create an auto drop down box. For example I already have a list of states that are pulled from the database. When the user selects a state, a drop down box below should populate with the cities from that state. (that's where I'm having trouble) This is a search form so the results have to reflect what city and state they chose. (along with some other criteria) I've searched all evening for instructions on how to do this and so far I've only seen javascript that you put directly in the code. If I have all 50 states along with their related cities that's an awful lot of code to put in the page. Isn't there a way to automatically pull the cities from the database to populate the box when the user clicks a state? I have no idea where to start to make that work.
Drop Down Menu
I am using the following code to loop 12 months backwards from the current month in a drop down list - using the get method. I'm having difficulties trying to get the option selected once I have submitted the form. For example, I am using this to filter months, so once a month has been selected and submitted, the first option in my drop down list is displayed and not the one that was selected and submitted. So basically, I need to be able to select a month > hit submit and when the form returns, have the drop down list show me the selected item. Code:
Drop Down Box Query
I am trying to do a drop drown box query where if you select a certain game type then the records in the database that have that game type are displayed in a table below. My drop boxs work fine, its the query to display the data that is troubling me. Here is my code:
Submitting Drop Down Value To DB
I am trying to create a form with a couple of drop downs and open fields that would be filled out and submitted by a user. I am having trouble figuring out how to tie the selected drop down value to the "Submit" command, so that it gets to the db. Here is my select code, but how do I submit to the db the value that the user selects out of the drop down? Code:
PreFilled Drop Down Box
I am working on some PHP code that automatically displays info from a MYSQL table in the drop down box. My code works fine but the only thing is it list 1 item that is the one it is pulling from the database and then the other default options that are in the code. Code:
Drop Down Menu
i want a drop down menu that will select which database is needed for that page.. see i have a site im making for a clan that plays like 10 different games and i wanna have 1 index but the dropdown menu will be at the beginning and when a player goes to the site they can choose which game they play so they can check the news and stuff.. the drop down menu should choose which database is needed? can this be done or will i have to make 10 different index.php pages?
|