Drop-down Menus

Apr 2, 2003

How can I create drop-down menus in PHP?

View 2 Replies


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:

View 9 Replies

Drop Down Menus

I am trying to build a database system to keep track of busdrivers and how much this company owes them. So what I have done is I have made 3 tables. One for the driver and info like name, address, city etc.

number 2 table with sales info etc. and the third = more slaes info. So what I am trying to figure out is how on lets say forms to be able to choose the driver and add sales info to it? So here are my tables: Code:

View 12 Replies

Drop Down Menus And PHP

I am making a simple email application in PHP, I am wanting it to have a drop down menu for the importance of the email. I have looked around on google and I do not seem to find anything.

View 3 Replies

Dynamic Drop-down Menus

I am developing an on-line booking system, and am designing a script which creates a booking "area". An area has the following fields:

Area Name
Day start time (the time of day bookings can begin e.g 9 AM)
Booking Time Slot (the length of time for each time slot e.g 30 mins)
Day Finish Time (the time of day bookings must finish e.g 6 PM)

What i require is a method for locking down the users input so that the finish time is a list that is created that is divisable by the number of minutes used for a booking time slot . e.g. if the start time is 9 am and each booking time slot is 30 minutes, then the user must select a finish time which is divisable by 30 i.e. either on the hour or half past.

I have looked at several methods for doing this but cannot decide what would be suitable.
Ideally I want the user to be able to select the start time from a dropdown (static html would do) the select a booking time slot (again a static html dropdown would surfice) and then a dynamic dropdown be created with a list of Day Finish Times.

My questions are these:

Is this the right way to go about doing this - are drop downs my best option? If so, is calculating the day end time list the best way to go? Would javascript be more suitable, rather than a php form?

View 5 Replies

Concatenate Drop Down Menus

We would lke to have two drop down boxes on a search page. for example one drop down will contain light bulb wattages( ie 40, 50, 60) and the other drop down will contain type of bulb ( round, oval, twisty etc.). These drop down boxes would be hard coded. no need to change them.

how would we concantenate the two drop down boxes. ie. if someone chooses "50" and "twisty" the result would be one field that would contain "50 twisty". how do we do this. Then we need to use this new field to search the database and extract all the prodcuts that meet the criteria.

View 4 Replies

Linking Drop Down Menus

I'm very new to the PHP world and I'm trying to create two Drop Down Menus that are linked. For example if the first drop down menu had all the States listed and the other drop down would show all the cities to choose from once a State was selected in first menu narrowing the list. Hope this makes sense and I hope the solution is simple at this point of my education level.

View 1 Replies

Self Populating Drop Down Menus

i am trying to do is the following: I have a MySQL database that (very simplified) has a schema like this 'Students(Name, id, Course)' I would like to have a form on a web site that has 2 linked drop down menus, one 'Please select id' and one 'Please select course'. When a user of the site selects there Id from the first drop down menu, i want the second drop down menu to populate itself with the courses held in the database for the given users Id. I would like the first drop down menu to be populated from the database with a query similar to 'SELECT id FROM students'.

View 3 Replies

Connectin Two Drop Down Menus

I want to create to drop down menus where the second one will display options according to the option selected in the first one.For example:

1st Drop down menu contains:
- Premiership
- Campionato
- Bundesliga
- La Liga

2nd Drop down menu should contain the teams of the championship selected fron the first drop down menu. Any ideas?

View 5 Replies

Drop Down Menus And Checkboxes?

I currently have an array that looks like this


I currently have two checkboxes(test and phase). What I am trying to do is if a checkbox is checked, a drop down menu will appear with the appropriate information. For example, if the test checkbox was selected, testA and testB would appear in menu. if the user also checks off the phase box, then the phases of the selected test will appear in another drop down menu. However, if the user only selects the phase checkbox, then all five phases will appear in the drop down menu. Anyone have any idea how to go about this?

View 9 Replies

Getting Data From Drop Down Menus

I have a drop down menu and I'm trying to find out which option they have pressed. I need to use the $_POST method to do this. Below is what i've written so far, but it's showing every time the messages:

"You don't have enough points" AND "you gained blah blah exp" I've blocked out some of the stuff that calls up files and stuff, just for security reasons Code:

View 2 Replies

Drop Down Menus And Form Processing

I select a client from the first drop down menu, then a list of events for that client is shown in the second drop down menu. I then want to select the event from the second drop down and automatically go to a form I built "editevent.php3" showing information echoed from mySQL for that event. I have started the code, but know it is not complete. Code:

View 10 Replies

Add Some Data From Drop Down Menus Into A Database.

I need to add some data from drop down menus into a database. The form loops on itself to add the data. I'm not sure which part I need to add the dollar too, i.e. the select name or the values in the list, in order to make it work. I've included part of the code below:

PHP Code:

$form.="Cateory 1*: <select name="cat"> ";
    $form.="<option value="Action">Action</option> <option value="Comedy">Comedy</option>";
    $form.="<option value="Drama">Drama</option> <option value="Family">Family</option>";
    $form.="<option value="Horror">Horror</option> <option value="Misc">Misc</option>";

View 1 Replies

Multi-level Drop Down Menus

I am building a search page. There are 5 drop downs from which the user can select search filters. However, some of the drop down list selections will invoke a sub-list.

I was hoping to use javascript only to invoke a refresh when the menu item was selected from the drop down, and then use php to re-build the form plus the sub-list drop down menu.

I can get javascript to refresh the page, but all other form fields are lost. I don't want the user to press "submit" to invoke a sub-list because a "submit" button implies that the search will begin, not that there will be more items to select.

View 1 Replies

SQL Query Based On Drop Down Menus?

I am currently trying to put together a query that searches a table of job vacancies in my database for any records that meet five criteria selected by the user from drop down menus. Certain jobs can be located in multiple locations and so in the table structure I have fields for location like this;


and a value of 1 or 0 is assigned to each field depending on whether it is true or false for that job. Now the code allowing the user to make a location choice looks like this:


My problem is that I can't for the life of me figure out how to translate the choice selected by the user into an SQL query that would give me the data I needed. Perhaps I need to rethink my database structure, I'm not sure.

View 6 Replies

Multiple Dependent Drop Down Menus?

I am trying to have 2 drop down lists created and have the 2nd drop down be based on the selection of the 1st. Questions:1) What would be more efficient, a mysql database or a CSV flat file to pull data from (assuming about 100-200 rows of data)?2) Do i have to use javascript for validation, to make sure the proper choices are selected (any drawbacks to using javascript?)

View 7 Replies

Php And Drop Down Menus Or Using Java Script?

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.

View 3 Replies

Insert Date Using Drop Down Menus

I know how to insert a date by filling in a field but I don't know how to do it using a drop down menu. One menu being month, another the day and the last the year. Any code snipplets I can disect and play with or tutorials on this?

View 2 Replies

Drop Down Menus And Mysql Insertion

I'm looking to create drop down boxes for a user to select the date and then have it insert what they select for month, day, year, hour, minutes and insert it into mysql. It needs to be organized in a timestamp like so: 2007-02-28 21:06:40

I've created the drop down boxes and it works pretty well: Code:

View 1 Replies

Creating Infinte Drop Down Menus

I have categories which contain sub categories which contain other sub categories etc etc....

Ive got a drop down which shows the first lot of categories, then another drop down displaying the sub categories depending on what the user clicked in the first place. Then another displaying the next set of sub categories depending on what they chose in the second drop down etc. Code:

View 5 Replies

Multiple Database Populated Drop Down Menus?

I have a page which is the code I provided. The page has a form. The form has a table row with four input fields. The first field on the page is a drop down box that is populated with data from the database. Once a user selects an option in the first drop down box it will populate the second drop down box with information that corresponds to the selection of the first drop down box. If I leave only these four fields I can get the functionality of the drop down population to work just fine, but what I want to do is have a second table row with a set of fields that are identical to the previous row and for it to have the same functionality of selecting the first drop drop down in that row to populate the second drop down in that row. The issue that I am having is that currently the first drop-down box in the first row populates the data in the second drop-down in the first row via a javascript function that refreshes the page in order for the second drop down to know what is selected. When I select an option in the first drop-down box of the second row or possibly a third row nothing happens. The second drop down box of the second row should populate data with what corresponds to the selection of the first drop-down of the second row.

Essentially I want the user to be able to do what they are doing in the first row over and over again.


View 6 Replies

Getting Information From The Drop Down Menus And Form Validation

i have a form that uses the post function however i am having some troble getting information from the drop down menus. and also i am having some trouble doing some form validation. the code for both files is shown

below.<html><title>Create a new Prequisite Rule </title>
<form action="insert_rule.php" method="post">
Rule Label:
<input type="text" name="rulelabel" /></p>
Rule Description:

this is the php file that handles the data that is collected from the file. right now as it stands i am able to get all the variables except those from the drop down menus and also i want to write some code that checks the the course is of a higher level number than the perquisite course however if it is the same then the semester number of the course must be higher that than that of the prerequisite course. that is what i was trying to do with lines 19-39 but continually getting an error that was referring to line 39[/QUOTE]

View 1 Replies

Values Into Radio/check And Drop Down Menus

I am attempting to create an update form where the current fields in the table are populated into input boxes and then can be altered where necessary.

I was wondering if it is possible to pre check radio buttons, check boxes and pre populate drop down menus based on the results currently in the table. eg. if the gender of a person is male then the radio button will be pre checked as male. How would this be done.?

View 13 Replies

Show Selected Value For Drop-downs In Dynamic Menus

I frequently work with forms where menus are pulled from a database. When a user enters data in the form and then saves it, if it is retrieved later, the form shows the saved data, including the drop-down menus.

The way I normally do this in php is to first retrieve the data for the saved from. Then I create the menus and within the loop of creating the menus I simply add the word "selected" into the results row which equals the saved option on the form. Code:

View 3 Replies

Modify Shopping Cart To Support Multiple Drop Down Menus?

I have a shopping cart script that I am trying to modify to support multiple product selection. As it is now, the customer can select a product from a single drop down menu. Now, I would like to add multiple dropdown menus (all populated with the same options).

Here is the php that outputs the dropdown menu:

".'<label for="eopt'.$theid.'"><select id="eopt'.$theid.'" name="option">';


Is there some really simple way of getting the code to output the menu say 3 times instead of once?

View 1 Replies

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?

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

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?


<?php $townsearch = $_get['town']; ?>

<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="get">

<select size="1" name="town">


<input type="submit" value="GO" />


View 12 Replies

Copyrights 2005-15 www.BigResource.com, All rights reserved