Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    PHP


SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





Drop Down List Menu.


How do I make one item required on my "drop down" list menu? E.g., let's say that I want one state to be selected, how do I make this possible with PHP? My PHP skill is amature, but I do understand most.




View Complete Forum Thread with Replies

Related Forum Messages:
Ordering A Drop-down Menu List
I am building a form that has a list/menu populating from the database. I'm using Dreamweaver to help code (which I know adds a mess), but I can usually edit it to do what I want. this is what it has:

<option value="<?php echo $row_rsPhysician['specialtyID']?>"<?php if (!(strcmp($row_rsPhysician['specialtyID'], $row_rsPhysician['specialtyID']))) {echo "SELECTED";} ?>><?php echo $row_rsPhysician['specialtyName']?></option>
<?php
} while ($row_rsPhysician = mysql_fetch_assoc($rsPhysician));
$rows = mysql_num_rows($rsPhysician);
if($rows > 0) {
mysql_data_seek($rsPhysician, 0);
$row_rsPhysician = mysql_fetch_assoc($rsPhysician);
}
?>

although if you have any generic code, I can play with it to get it to alphabetize my list. (the list is specialtyName and specialtyID is going into the database.

View Replies !
Chain Menu But The Menu Should Be Multiple Select Menu/list
I am looking for codes to be able to do the same thing with multiple select menu/list.

PHP codes or javascripts codes are both fine.

1) javascript + php approach: Prefer to be javascripts codes to display the chain menu. I can use the php to get the all three levels menu data from the database, and assign these values to the javascript.

2) php codes only: Or use the pure php codes (the problem is if just using php codes then I have to submit the form to the server every time, when top level menu select changes to create new menu.).

View 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
$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 Replies !
Produce A List Of Tables Currently Within My Database And List Them In A Drop Down Box.
I need to produce a list of tables currently within my database and list them in a drop down box.

View Replies !
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:

View Replies !
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:

View Replies !
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.

View Replies !
Get Value In A Drop Down Menu
I try to build a drop down menu in a record update page the page get the id record to update the page example update.php?id=2

In the drop down menu, are there anyway I can get the value of the record that already insert? Everytime when i update the record, i have to set this level again. Code:

View Replies !
Drop Down Menu And Php
the problem is i am trying to have the code work so that whoever wishes to add to the options given in the drop down menu can by choose add new option. the page seems fine and doesn't give me any errors but it doesn't seem to be adding the new option in the drop down menu list.

View Replies !
Using Drop Down Menu
I have big problem. i have post this problem in alot of forums, but nobody help me. i have hear from my friend phpbuilder is the best php forum. so i to i register here. approve/delete comments using Drop Menu, look at the below example : Click here to view the example I want to approve some comments and to delete some comments.

View Replies !
Php Drop Down Menu Variable
I have been playing with one script for more than two weeks. It is a simple poll script.
Once the user has selected from a drop down menu...it is mailed to me. The problem is that I only get the first word of their choice! That defeats the purpose of having the poll!

View Replies !
Echo Drop Down Menu
What I do is when the form is posted (php_self) it does its check and if there are errors, ie. user has not filled in required data, it takes them back to the form but the text fields are already filled in with what they have already typed.

But the drop down menus default back to the PLEASE CHOOSE option, how can I get my drop down menu to be what they have just selected. The reason I need this is there are 6 drop down menus for different things on the page and a user would get fed up having to reselect each one when they have not filled in a field. Code:

View Replies !
Populating A Drop Down Menu
How would I go about populating a Drop Down menu from data in MySQL? If you can show me wither a URL to learn this, or if you feel like telling me here, that would be great.

View Replies !
Query Using Drop Down Menu
can i query a table based on a drop down list?

i have a list of agents that i just want a simple drop down list to show the records they entered....

right now i just have the entire table showing all records in a html table format...but i want a drop down list so that if they only want to see the ones they entered, they can just select their name and poof...only theirs are shown...

View Replies !
Drop Down Menu Refreshing
Sites that have mulitple drop down menus where 1 menu decides what the next menu will contacin, after you select the otion you need in menu 1 the next menu refreshs with its new contents and so on and so on..Is this done with Java?

View Replies !
Updating SQL From Drop Down Menu
i am trying to change a php asset program to include another drop down menu ,
I have created the drop down and it shows the correct entries from Audit in sql , the process is that the user completes the php form for a new asset then clicks save to enter it to the database , the details below adds another drop down menu once they have selected the correct value i do not know how to capture this and write it back to the sql database . Code:

View Replies !
Dynamic Drop Down Menu
I'm having difficulties displaying the MakeModelID for a row selected from a drop down menu I've populated from a table combining three attributes (Make, Model and Specification - for example Ford Transit LWB 350 HR). What I require is to capture in a variable, such as $MakeModelID, the ID for that record selected. Code:

View Replies !
Drop Down Menu Web TV Friendly
i am currently the owner of a game and some of my players cant access all the pages in the game because they cant see the drop down menu as they are using web tv. Code:

View Replies !
Drop Down Menu Values
I have a form below that shows a dropdown menu. The values are email addresses populated by my SQL database, with their associated names placed between the option tags. (Don't ask why I'm using a SQL database - not my decision) My dilemma:

I need to insert the $ManagerName into another database, while at the same time emailing them. I DO NOT want to insert the email address into the database.

Currently it won't work because only the value is entered into the database, and not what is showing in the selection list. Code:

View Replies !
Drop Down Menu Without Using A Database?
A lot of people are turning off javascript on their browsers so the script doesn't always work. I would like to know Is their a php script that can do the same thing without using a database? Can I get the links to open in a new window when they are selected?

View Replies !
How To Make A Nav Menu Drop Down In Php
i am interested in learning to make a drop down menu bar - the ones you hover the mouse over and a drop down list of choices (with an almost transparent bg) comes down. then when click it takes you to another page that has another sidebar which highlights the page you are in.

so on the side bar you can click and both the img on side bar and the menu bar will change so to indicate what section of the site you are in.

View Replies !
Re-create A Drop-down Menu
I have 2 drop-down menus (1) States (2) Shows By State. how do I invoke a re-build of the Shows By State drop-down when the user requests a different state. I believe this has to be done with Javascript and I don't know Javascript. Could someone supply a small example of how this is done? I am using PHP and MySQL. Following is the PHP code for building the state drop-down menu:

<tr><td bgcolor="#EFC891" width="496" align="left"><b>Select a Show in Your
State:&nbsp;&nbsp;

<select name="ShowState" >
<?php
$stateName=getStateName();
$stateCode=getStateCode();
for ($n=1;$n<=50;$n++)
{
$state=$stateName[$n];
$scode=$stateCode[$n];
echo "<option value='$scode'";
..............

View Replies !
Dynamic Drop Down Menu?
I have a customer table and I wish to be able to dynamically generate a drop down menu, to, for example, select the customer for which operations are to be performed.

after I have made the initial select statements, I assume i will then need to use a while loop

but this is where I am getting stuck....I am familiar with using while loops for creating tables dynamically but i'm not sure about drop downs. I just wish to show "company name" in the menu.

While it be something along the lines of....

while ( $row = mysql_fetch_array ( $sql )
option = $customer_name
etc..

View Replies !
Keep Selection Of Drop Down From Menu
Im just working on a enquiry form submission script. When the form is submitted a php scripts checks for empty fields etc. If a empty field is found the for comes back and a error messages is displayed.

When the forms re-appears the fields which werent filled out correctly before stay filled in, simply putting setting the fields 'value' with the $_post variables.

Now this is ok but is there a way so if the users selects a choice from my drop menu the first time that this choice remains when the form re-appears if something else was found to be invalid ??

Hope I explained that ok?

View Replies !
Nested Drop Down Menu
I am very familiar with php but I don't know javascript very well at all, and I suspect I may need to know some for this, so I'm looking for some pointers.

I need to create a set of nested drop down menus that populate using data from a mysql database.

So here's an example.....

View Replies !
Drop Down Menu Redirection
Im having some troubles. When a user selects a topic from a drop down I want it so that when they click submit it brings them to a corresponding html page ....

View Replies !
How Do You Create Sub Drop Down Menu?
I have been wanting to create this for my site but i am not sure how. I would appreciate if anyone could show me some example code of how it's done.

What want to do is basically, say there are 2 drop down menus on my site, one for country and one for region. Say in the country menu you select UK, i would like all the regions in the UK to show up only, and if you select another country, only the regions in that particular country will show up. I am sure you understand what i mean. I would be very grateful if someone could show us how this is done.

View Replies !
Assign Value From A Drop Down Menu
I am trying to assign a value to a PHP variable from a drop down menu. The default value is "no." However if "yes" is chosen, I want that to be assigned to $_POST['local_pickup']
Here is what I have so far:

<select>
  <option class = "blue_standard">No</option>
  <option class = "blue_standard">Yes</option>

<?php if ($_POST['local_pickup'] == 'yes') echo $_POST['local_pickup']; ?>

</select>

Can anyone suggest how to get the yes value assigned to the $_POST['local_pickup'] variable if "yes" is chosen.

View Replies !
Add Values To A Drop Down Menu
I am trying to use this code to add values to a drop down menu. I can tell the variable is being passed to the correct document(PHP_SELF) however the value will not store into the mysql table. is my syntax incorrect?

I've read and copied and pasted several samples of scrips attempting the same task but they are causing parse errors. Code:

View Replies !
Selected Value In Drop Down Menu
I want the first option ("selected" option) in a drop down menu to be based on the URL a user clicks on. For example, if the user clicks on the link:

layouts.php?submit=true&category=abstract

The first and selected value in the drop down menu should be abstract
Then the rest of the menu will pull from the database.

The code I am using now (below) lists all my categories from my database, but it is not putting the selected value first. How can I get this to work?? Code:

View Replies !
Drop Down Menu Of Pictures
I will be here for a long time to help others. You have to share your knowledge. Anyhoo, I would like to know if this is possible: Drop Down Menu of Pictures. Choose your host: (drop down menu of host faces). Keep in mind I'm totally new to PHP so if my question is really stupid, please don't hurt my feelings.

View Replies !
Populating Drop Down Menu
I use the following code snippet to build a drop down menu with the
results of a query. How can I set the initial value of this input based
on the result of another query?

What I am trying to do is update records in the data base. The field
WkEndDate is pulled along with the rest of the record and the drop down
menu is built from a table of valid WkEndDate values. Code:

View Replies !
Drop-down Menu Item
I am looking for a way to submit my form without having the user click the submit button. I would like them to choose one option from a drop-down list, then I would dynamically populate the next drop-down list and so on, as in car buying websites. Choose Make --> then it populates the models ---> Choose Model. I gave this a try in Javascript but was unsucessful. I prefer to do it in php if possible because the user may have Javascript disabled, but if anyway knows of a sure way of doing this in javascript, I'm also open to that as well.

View Replies !
Verify - Drop Menu
I have a form in HTML and a verification php file to check all required fields. Everything is perfect, except I don't know how to check drop menus (state, and topic). I'm using this code for the other fields:

if (!ereg("^[A-Za-z]{1,}$",$firstname)){
echo ("<center>You entered an invalid <font color="#FF0000"><b>FirstName</b></font>.</center>
");
echo ("<br /><br />");
$validated = false;
}

View Replies !
Dynamic Drop Down Menu
I'm trying to send emails to different users based on what is selected from a dynamic drop down list. Here is what I have that doesn't work: PHP Code:

<?php
$to = "me@myemail.com";
$subject = "current email test";
$message = "New RMA FORM FOR $rma";
$id = $_POST['status'];
$query = "select id from mytablename where id='$id'";
$result = mysql_query($query);
if (mysql_num_rows($result)==1){
    mail($to, $subject, $message);
}
?>

View Replies !
Getting The Data From A Drop Down Menu
I have a sequence of drop down menus but I don't know how I can store the responses in other variables. Right now the output I'm getting looks like:

location1 [status1] [change]
location2 [status2] [change]
location3 [status3] [change]
.
.
.
.

where all the [status] are drop down menus and the [change] is a submit box. I'd like to use the change button to change the status of the location in the mysql database. How can I at least get my hands on the location that they modified and the new status of that location? Code:

View Replies !
Multiple Search With More Than 2 Drop Down Menu
I have problem with multiple search with more than 2 drop down menu. After submit from search.htm, in the results.php page i dont get results or error and i dont know where the problem is. look my code and tell me if you see something or error in sourcecode PHP Code:

View Replies !
Select Table From Drop Down Menu
I'm trying to select a table to submit form data to from a pull down menu. How do I submit the table along with the input data? I know I need to modify this line ($sql = " INSERT INTO $dnc "; )somehow to use the table selected in the pulldown menu. Code:

View Replies !
Drop Down Menu Selection Activation
I have a form that is populated with a drop down list and a list box. I
want to be able to automatically populate the list box, whenever a user
selects a new item from the drop down list.

Is there a way of doing this as soon as a new item is selected from the
drop down box? (I'm trying to mimic a rich client interface in a web
browser).

View Replies !
Creating Dynamic Drop Down Menu
I have a mysql database called Auditions with a table called Sept7. The table has two columns Time and Name. I want to create a dynamic pull down menu and populate it with items pulled from the table based on a query. Code:

View Replies !
Showing What Was Selected In Drop-down Menu
I'm trying to create a form where the user inputs data, i validate it with php, and if some of the input is missing or invalid then i print out errors with the form filled out with the information they entered/selected previously so they can change/add to it.

The problem I'm having is setting my drop down menus to be selected when the form is returned instead of returning their original state. The menu I have is named A ($A). Here's an example of what I'm doing that isn't working: PHP Code:

View Replies !
Default Select Drop Down Menu?
I have a drop down menu populated via a script that pulls all categories from the category table. However, when a user clicks to view a specify category (i.e. Toys), I want the drop down menu to display toys as the default value. Code:

View Replies !
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.
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?

View Replies !
User Selection From Drop Down Menu
I have 2 drop down menus. 1 is to pick a Province and the other is to
pick a trade (plumbng electrical etc)

The user selects which province and then what trade then hits submit
which should list all entries in the table. How would I formulate the
select statment for MySQL to display the results in a webpage. The
variable in my form are $province and $category

View Replies !
Drop Menu Using Session Data
I've a drop menu for users to choose the month they are born from. There's an associative array, $nameOfMonths, for the months' names. E.g. [1] => 'January', $birthMonth would be an Int.

If there's session data, it will print the user selected month, followed by a list of months. If there's no session data, it will ask user to select a month, followed by a list of months. I wonder if this is the best way to code this drop menu. Code:

View Replies !
Chain Selection For Drop Down Menu
I have a java script that has a drop down menu where a person select a state and then all the cities for that state show up right next to it.

my problem is that the script it is making the webpage runing slow, or sometimes is telling me that the insternet explorer is running slow because of it and i was wondering if there is a better way to do this with PHP and where should i start

View Replies !
Changing Name Of Drop Down Menu Dynamically...
is there a possible way that..i can change the name of drop menu dynamically using js... and even changing it in a looping statement?

View Replies !
Dynamically Populate A Drop Down Menu
I was able to get information out of a table. know I am trying to dynamically populate a drop down menu. I am having some trouble populating the option value with  $row['f_name'] " " $row['l_name'] The same issue with the option display name. Code:

View Replies !
Mysql Fetch With Drop Down Menu
Im trying to do somekind of dropdown menu taking information from the database but im not quite sure how this could be done with my knowledge.

alright so lets say i have a table named: projects SELECT name FROM project. and it will put all the data found in a html drop down menu?

View Replies !
Passing Data From A Drop Down Menu
I have a website that I am working on. When the user logs in they see a drop down box and they are supposed to go to this box and select their name. How would I get the selection that they made to pass to the next page.

This is my code for the page with the drop down box that I have so far. It pulls from my database, and it works fine. Code:

View Replies !
Multi Drop Down Menu Population
I am having problems getting the 3rd and 4th drop downs to work properly. What am I doing wrong? Also is there an easier way to do this using one table insead of multiple SQL tables? Code:

View Replies !
Drop Down Menu Validation Against Database
I want to do a query which selects the config.maps table.field WHERE ladder_id = $ladder_id. I can do this fine, but the next bit is slightly harder.

The maps are stored as an array, separated by commas. I can explode these commas to put the maps in to an array called $maps but how can I then check that a value inputted from the drop down menu matches one of these maps?

I cannot do:

if ($dropdown = $maps[1] || $dropdown = $maps[2] || $dropdown = $maps[3]) {

 // Continue

}

View Replies !

Copyright © 2005-08 www.BigResource.com, All rights reserved