Drop-down Menus

Apr 2, 2003

How can I create drop-down menus in PHP?

ADVERTISEMENT

PHP And Drop Down Menus

Nov 30, 2000

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 View Related

Drop Down Menus

Jul 25, 2007

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 View Related

Drop Down Menus And PHP

Jun 15, 2006

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 View Related

Dynamic Drop-down Menus

Mar 7, 2003

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 View Related

Concatenate Drop Down Menus

Aug 8, 2006

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 View Related

Linking Drop Down Menus

Jul 6, 2006

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 View Related

Self Populating Drop Down Menus

Oct 3, 2005

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 View Related

Connectin Two Drop Down Menus

Jun 21, 2007

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 View Related

Drop Down Menus And Checkboxes?

Jun 22, 2009

I currently have an array that looks like this

array(
[testA]=>array(
[0]=>phase1,
[1]=>phase2,
[2]=>phase3
),
[testB]=>array(
[0]=>phase4,
[1]=>phase5
)
)  

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 View Related

Getting Data From Drop Down Menus

Jul 28, 2007

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 View Related

Drop Down Menus And Form Processing

Jan 6, 2001

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 View Related

Add Some Data From Drop Down Menus Into A Database.

Dec 28, 2005

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>";
    $form.="</select>

View 1 Replies View Related

Multi-level Drop Down Menus

Mar 25, 2007

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 View Related

SQL Query Based On Drop Down Menus?

Feb 17, 2010

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;

location_London
location_SouthEast
location_Northwest

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:

[code]...

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 View Related

Multiple Dependent Drop Down Menus?

Jun 1, 2009

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 View Related

Php And Drop Down Menus Or Using Java Script?

Apr 14, 2006

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 View Related

Insert Date Using Drop Down Menus

May 25, 2007

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 View Related

Drop Down Menus And Mysql Insertion

Mar 1, 2007

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 View Related

Creating Infinte Drop Down Menus

Mar 8, 2007

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 View Related

Multiple Database Populated Drop Down Menus?

Feb 5, 2010

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.

Code:
<?php
session_start();
include("db_connect.php");[code]......

View 6 Replies View Related

Getting Information From The Drop Down Menus And Form Validation

Jan 20, 2010

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>
<body>
<form action="insert_rule.php" method="post">
Rule Label:
<input type="text" name="rulelabel" /></p>
<p>
Rule Description:
[Code]....

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 View Related

Values Into Radio/check And Drop Down Menus

Mar 26, 2007

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 View Related

Show Selected Value For Drop-downs In Dynamic Menus

Oct 8, 2007

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 View Related

Modify Shopping Cart To Support Multiple Drop Down Menus?

May 18, 2010

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:

if($eshopoptions['options_num']>1){
$opt=$eshopoptions['options_num'];
$replace.="
".'<label for="eopt'.$theid.'"><select id="eopt'.$theid.'" name="option">';

[Code]....

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

View 1 Replies View Related

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?

May 16, 2006

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>
&nbsp;
</select>&nbsp;

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

</form>

View 12 Replies View Related

Menus In Php

Jun 21, 2006

currently i have web application in php which has its menus created in
javascript.
if we do view source on the page, it displays all the javascript which
is obvious n natural.
but it displays all the file names of php too which are related with
those specific menus.
dont we have any way by which we can prevent it.
as an alternate i m thinking of creating the menus also in php so that
the names of my files dont get visible to the user from the security
point of view.
is it sensible to do so because it will be an extra overhead to the
system for creating the manus everytime.

View 2 Replies View Related

Menus

Aug 22, 2005

I'm looking for a way to build a dynamic menu systems. I have a project that I have under way that will help you spec a computer system. I will be using drop down (select) menus, and I wanted to know if its possible that if you select one option that it would remove certain options from the next menu as they would be incompatable with what was selected above.

View 4 Replies View Related

& Menus

Aug 2, 2004

Firstly I am a fairly recent newbie to PHP & MYSQL but I am catching on pretty well. I would like to use them to build a dynamic menu system for a catalog type website.

I have several 'category' names that can change. I would like to recall the category names from the database and use them to build a set of menu 'buttons'. When a button is pressed, I would like to assign & pass a variable (the category actually) back to another php script that searches the database for all items in that category and builds a display page.

I have most of it figured out except the part about how I can construct the menu so I assign & pass a different variable out of the menu when each button is pressed.

View 1 Replies View Related

Do Menus

Jun 18, 2007

what way is the best way to do menus and MULTIPLE layouts and languages in PHP?

View 7 Replies View Related

Drop Down Lists Changing Depending On Other Drop Downs

Oct 28, 2007

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 2 Replies View Related

Sticky Menus

May 16, 2003

It's common courtesy to ensure that a form with validation problems reposts with the fields still filled in, so the user doesn't have to start over, by echoing the variables in the Value attribute of the text fields, but I also want to have a drop-down menu to be sticky and retain its selected state when the page reposts.

View 4 Replies View Related

Dropdown Menus

Jul 16, 2005

i would like a Dropdown menu ordered by the parent cat and then showing its sub cats like below:

<SELECT>
<option value=0>Cat Name</option>
<option value=?>-Sub Cat</option>
<option value=?>-Sub Cat</option>
<option value=?>-Sub Cat</option>
<option value=0>Cat Name</option>
<option value=?>-Sub Cat</option>
<option value=?>-Sub Cat</option>
<option value=?>-Sub Cat</option>
</SELECT>

View 2 Replies View Related

Dymanic Menus

Feb 26, 2006

I have products stored in a MySQL database with each product belonging to a category. That category may sit under one or more other categories. What I need to be able to do it produce the site navigation based on the different categories and their parent categories. So basically I need to be able to produce the following HTML dynamically based on the categories store in the database.

<ul>
<li>Category 1</li>
<li>Category 2</li>
<li>Sub Category 1</li>
<li>Sub Category 2</li>
<li>Sub Sub Category 1
<li>Category 3</li>
</ul>

How would you store the category information in the database and what would the PHP script look like to produce the navigation?

View 1 Replies View Related

Nested Menus

Mar 25, 2007

In each of my .php web pages I include("menu.php") which contains a menu of links to my web site pages.

How can I modify this simple model (without using a database) in order to create a nested template?

Do I have to create a different menu.php file for each group of second level pages? Or can I accomplish a two level menu with a single menu.php file (and still without using a database)?

View 1 Replies View Related

Selecting Using Pull Down Menus ??

May 10, 2001

Just wondering how do u create that "ALL" search in php. For example i created a simple pull down menu (category) that has 3 options where each option has an id no. So my select command is " select * from tablename where id = /"id/" and lets say option 1 will have id 1 and so on.

But what i got stuck in was creating an ALL search does n e one know how to do them ?

View 1 Replies View Related

Dependent Select Menus

Jan 23, 2007

I would like to create a form in which a 2nd select box appears
depending on the value selected in the 1st select box. The values of
the 2nd select box will come from a database.

My question is how to create this in php? One way is to re-load the
page depending on what's chosen in the first box, or alternatively to
use frames or an iframe?

Is there another, better way that can dynamically change the initial
page?

View 2 Replies View Related

Dropdown Menus Problem

Nov 12, 2005

I have two drop down menus in my php script. The items displayed in the second is dependent on which item is choosen from the first i.e. the choosen item from the first filters the items in the second Code:

View 4 Replies View Related

Select Menus Query

May 13, 2005

I have created numerous select menus where the user can if they so wish select all or any one of them.

At the moment my code insists that they always select at least the subfund menu. How can I set it up so that they can select any one menu? Code:

View 9 Replies View Related

Database Driven Menus

Jan 28, 2006

Im looking to pick the brain of someone with experience in creating menus that dynamicly alter depending on the content of a database which the site uses. I havent tried anything like this before so advice on technologies, techniques and common pit falls would be greatly aprishiated as would any scripts that i could adapt to use which would give me a good idea how everything fits together.

i need a menu that displays a number of catagoires (dependant on the number of catagories in the database) and then a number of sub catagoies also if the color scheme could be easily adapted that would be ideal.

View 2 Replies View Related

Default Value For Form Menus

Sep 2, 2005

I'm building a page that has three list/menu form objects that all should be the same (allowing the user to select 3 options from the same list). Since the values of the menus are the same and come from my MySQL database,

I needed to reset mysql_fetch_assoc with mysql_data_seek so fetch would start back at the beginning of the list... hope that's clear. The problem is that the first menu starts off with the first item in the list, but the next two start off with a blank space. Code:

View 5 Replies View Related

Add Different Menus In Different Pages In Joomla?

Oct 10, 2010

I wanna integrate a site similar to [URL]. In this site when you got Services menu, there they have different menu in the left side. Again when u goto Products menu they have a different menu in the left. In the other pages no menu will be shown. How can I do this in joomla. In joomla it displays the same menu in all the pages. I've created the top menu and linked them to the articles. But I want to create the left-side menu for the Services and Products page. The one that I've created is [URL]

View 1 Replies View Related

Checkboxes And Dropdown Menus Sent?

Jul 4, 2011

I'm working on an order form that has check boxes and drop down lists. Below is the html form.

HTML Code:
<form method="post" action="post.php">
<input type="checkbox" name="order[]" value="Item One" />
<select name="qty[]">
<option value="" selected="selected">Qty</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>

[Code]..

I need the selections to be echoed out on the next page kinda like this

Qty Item
2 Item One
4 Item Two

I can get them to echo out separately, but don't know how to do them together.

View 2 Replies View Related

Css Menus In Submenus To Use Select Box?

Oct 14, 2009

Requirement css menus in those submenus I have to use select box.In ie7 I am trying to select any value from select box sub menu is disappearing.Due to focus change in ie only.

View 2 Replies View Related

Create Menus And Submenus ?

Sep 30, 2010

How to create menus and submenus in PHP

View 5 Replies View Related

ADVERTISEMENT