Dynamic Dropdown Lists
I am recoding a greeting card website.
I am using dropdowns as filters for items in a DB, so when the user picks "animals" from the "theme" dropdown, the returned cards all feature animals, and when the user picks "birthday" from the "message" option, the returned cards all feature birthday cards.
However, there are some combinations that don't return any results, for example "get well" "floral" cards. Code:
View Complete Forum Thread with Replies
Related Forum Messages:
Dropdown Lists
I've been doing a site for a while now that has several drop down lists in a form. On one form there is the same drop down list repeated 3 times from the same table in a database but with different values. What would be the best way to repeat the code without repeating all of the code. Basically looking at an more economical way to do things. Would you do a while statement and loop through them or maybe a single array and call it when you need it. Any opions?
View Replies !
Classes And Dropdown Lists
The class below works fine. The problem I have is there's a dropdown list in the middle of the loop. The dropdown list gets its data from another table in the database. Which goes through the same class. So I have a loop within a loop. What I'm trying to do is ....
View Replies !
Create State-cty Dropdown Lists
I've gotten everything up and running except for this -- I'd like to be able to have people have a dropdown list of cities in the US to use (or wherever) and not have to input them manually into a text field. When you do then there are issues of misspellings, etc. Now I have a list of cities from each state that is a sample that works in an html page. Problem is that it takes up 2 MB! Way too much to load on a single page and I was wondering how this is accomplished best -- do people use javascripts that can pull information from another flat flie? Do people use PHP to connect to a mysql database that might have a list of these fields and then reloads the page? I'm really not sure of best options and would be grateful for anyone to give me pointers or whether there are other examples and even places to buy these databases (not likely but good to have if I decide to do so.)
View Replies !
Get Two Dropdown Lists Working On A Page
i am trying to get two dropdown lists working on a page. How do i go about this. For example, I have 1 table which holds countries and cities. When a user selects a country in the first dropdown list, i'd like the second dropdownlist populate with a list of cities etc. from my database.
View Replies !
Dynamic Dropdown And Hardcode Dropdown In Select Form
I have plenty of examples of dynamic dropdown choices but none of hardcoded dropdown choices. The ultimate goal is to have a job with various tasks and to track the status of those tasks for a given job. I've used one of the tutorials here to begin the process. Below is the code I have to add work on a given task. Perhaps I actually need to "Update" a job as opposed to "add". But the problem of the moment is I can't seem to hardcode one set of my options. This is the code I have: PHP Code:
View Replies !
Auto Select Dropdown Lists From Db Values
I want a simple HTML drop-down list like this: Code: <select name="select_1"> <option name="option_1" value="option_1" selected="true"> <option name="option_2" value="option_2" selected="false"> </select> to be able to automatically select a value according to a value in a table in the database. For example, if a MySQL table has a field named "field_1", and one of the rows has a value of "option_1" in that field, I want the list (using PHP of course) to automatically select the option name "option_1".
View Replies !
Dynamic Unordered Lists
I have searched about for this one but havent quite found the low down i'm looking for but here goes. I'm trying to dynamically populate an unordered list from an SQL database which will have upto 5 or 6 sub-selections per top level list item so.. it would do something like this: Code:
View Replies !
Dynamic Drop Lists For Modify
Hello, I hope this is posted in the correct forum. This is a mix of php and javascript and what I am trying to do combines the two so I hope this is the best place for this post. I have 2 situations, one when adding an employee and the other is modifying the employee. I have a drop list the holds all of the companies that when you select a company, it changes the droplist of departments to show the available departments for the chosen company. So the dept droplist dynamically changes based off the company you choose. I have this working perfectly. THis is for adding an employee. My problem I have now is I need to modify the employee and when you first pull up the form with the employee info, it is populated from a mysql query. The droplist for companies is selected to the correct company, however, the droplist for depts is not because the javascript code I have is set to fill the dept list on an onchange event which on page load does not exist. If they select a different company, my code works fine but when they first hit the page, the dept list is blank because the onchange event has not been kicked off. I realize this is javascript but I am not sure where my changes need to be made. below is my code for the companies and depts only. I will leave out the other employee info becasue it is irrelavent. I will post what I have so far and hopefully you can guide me in the right direction Code: ....
View Replies !
Dynamic Dropdown?
I am posting a code for dynamic dropdown by Leon Atkinson, it works fine but i have a doubt: I tried to add another functionality to it where i got stuck! Once the city also gets selected from the second drop down i wanted that on clicking the submit button it should go to some html page wrt to the city choice. Code:
View Replies !
Dynamic Dropdown Box
im looking to have two drop down boxs one with makes of car and the second drop down box to automatically populate with all the model of that particular make of car. there are about 50 makes and upto 50 models per make. I just would like to know the best way to do this - javascript or use a database? it would be a lot of code todo it in javascript wouldnt it?
View Replies !
Dynamic Dropdown
This may be rudimentary but I'm just trying to get my head around this without having to write a billion lines of extraneous code. I have a dropdown selection list, populated from a mySQL database, containing times in a HH:MM:SS format. The times are 30 minutes interval spanning an entire day, as in 01:00:00, 01:30:00, 02:00:00 all the way to 24:00. I have it entering fine into the database, but when I want to edit this time, I'd like to have the value in the database be marked as the CHECKED value on the dropdown so I don't have to manually re-enter the time for every edit.
View Replies !
Dynamic Dropdown Menu
with help from the PHP Gurus here, I have a dynamic menu script: PHP Code: <?php $time = time() + 28800; $time_plus2 = strtotime('+ 6 days'); echo '<select name="select">' while ($time <= $time_plus2) { Â Â Â Â echo '<option value=>' . date('l, F d', $time) . '</option>' Â Â Â Â $time = strtotime(date('Y-m-d', $time) . ' + 1 day'); } echo '</select>' ?> how do I now get the days of the week to link to different pages?
View Replies !
Dynamic Content Using Dropdown
I have the following dropdown menu which is populated by content or categories (with catID being the category ID) from the database. What I want to do though is when an item in the drop down list is selected, I want to show dynamic content under it. BTW, I must not emphasize on "dynamic" too much because it may seem like a DHTML thing going on here. For example, if a user selects a certain item/category in the list, I want content such as coupons in the DB which have the same catID as the category selected showing up. The coupons are discreetly placed in the DB table "coupons" with the category ID being catID and...for eg: catID --- couponname --- couponinfo --- expiredate If you are going to include any kind of javascript, please write them as well. Here is the code I am starting off with: =========================== <form name="myform"> <select name="selectID" size=10 > <? $resultcat = mysql_query("SELECT * FROM Category"); while ($myrow2 = mysql_fetch_array($resultcat)) {?><?printf("<option value=%s>%s</option>", $myrow2["catID"],$myrow2["name"]); } ?></select></form>
View Replies !
Three Dynamic Dropdown Boxes
Can any one help me in dynamic drop down creating? I have three dropdowns One for Country one for state and one for location. My plan is to select the country from dropdown according to this i have load the values in state drop down from MySql table. Depending on the state i have to select the location too.
View Replies !
Dynamic Dropdown Menu Glitch
I wrote this code to dynamically generate an array from files on my server and put it into a drop down menu, but the code cannot be inserted on any page anywhere without it cancelling the loading of the rest of the page. Any ideas? Here is the code: PHP Code: <? $the_array = Array(); $handle = opendir('walrus/strips/.'); while (false !== ($file = readdir($handle))) { Â Â Â if ($file != "." && $file != "..") { $file = substr($file, 0, -4); $the_array[] = $file; Â Â Â } } closedir($handle); asort ($the_array); reset ($the_array);.....
View Replies !
Network Bar, Dynamic, Dropdown Menu
Basically I have a "network bar" that I place on the top of all my sites, which has a dropdown menu box to interlink all my other sites. Basically I would like to really modify this idea out more. Code:
View Replies !
Dynamic Fill Form Fields Depending On Dropdown Box
This question has probably already been asked, but let me ask again I have a mysql database to which I connect with my php scripts. The database contains articles. Name, Unit_Price and Reference Now my client needs to order 5 items, click a button and a table with 5 lines and 3 columns appears (until now easy) In the first column is a drop down box with a <select > and <options> in which I store all possible names. I would like than whenever the client changes one of the boxes (in my case there are 5) the Unite_Price column and Reference column in the line he just choose get automatically updated
View Replies !
Creating Dynamic Page Based On Dropdown Selection?
I'm using Dreamweaver, but I believe this is a general PHP/MySQL question. I have a table, with 4 fields: id, year, car_make, car_model. The data looks like this: 1 1992 Honda Civic 2 1994 Ford Probe GT 3 1999 Audi S4 4 2002 Porsche 959 On my web page, I have a drop down list that's propogated automatically with the "car_model" field entries which are pulled from that table. So when I click the down arrow, I see Civic, Probe GT, S4 and 959. Code:
View Replies !
Data Entry Form With Dynamic Dropdown Boxes
I am working on a Form for user to register & enter their info such as name, email, address, tel etc. and I put in a couple of dropdown boxes namely country and city where user can select. I made them dynamic, i.e. the city dropdown is based on the selected value from country and the data retrieved from MySQL database. The problem I have is the Javascript script involved a reload of the form and once I select a value from Country, the city dropdown populated with data OK but the data entered beforehand (Name, email, etc.) disappeared.
View Replies !
Mailing Lists
I have searched in many places about how to set up a mailing list that is scalable yet no web sites seems to want to give out this info. I need to have this mailing list be effective even up to hundreds of thousands of users. Any advice/resources on how to set up this mailing list?
View Replies !
Email Lists
How would I go about making email lists? Someone who has something similar to what I want told me that they handle it with PHP. I'm not talking about a form where I can email an entire list, but rather an email GROUP, such that any time email went to URL from ANYONE that is a member of my site, it would come into domainname.com, and then sent back out to everyone in the "group". Any info would be helpful. Is this possible with php? What is the email process? Right now I'm not even on a domain name on my own server.
View Replies !
Ordering Lists
I have developed a script (with help) that tries to order events stored in my .txt file by date. The .txt file looks like this: 1st|Jan|Meeting at House| 15th|Feb|Meeting at your House etc The script orders the dates from lowest to highest but does not order dates before the 10th. Apparently 1st - 9th comes after 31st.. Code:
View Replies !
PHP And Drop-down Lists
I want a simple HTML drop-down list like this: <select name="select_1"> <option name="option_1" value="option_1" selected="true"> <option name="option_2" value="option_2" selected="false"> </select> to be able to automatically select a value according to a value in a table in the database. For example, if a MySQL table has a field named "field_1", and one of the rows has a value of "option_1" in that field, I want the list (using PHP of course) to automatically select the option name "option_1". How would I go about doing that?
View Replies !
Drop Down Lists
I have used Php to generate a drop down but becos the action of the form is it itself ($_SERVER) I need to echo the value upon submission. Becos this is php generated I'm having problems. This is what the current code looks like: [PHP] echo "<select name="branch"> <option value="$variable">$variable</option> </select>";
View Replies !
Maintaining Mailing Lists
I've few doubts; I'm asking two problem here. 1st, can we use PHP for maintaining mailing-lists. Say, we've 1000 users, need be e-mailed a subscription newsletter i.e. $message is same, loop through e-mail array in db. 2nd, Web site search. We maintain database after reading files using PHP and manipulate results from db. Question is, if PHP is a solution for these problems, also, when users' ( 1 ), keywords' ( 2 ) dbs grow big! There is also a limit of a PHP script execution. In 1st case, PHP has to parse, suppose 10k subscribers, and generate 10k e-mail for sendmail program. Is PHP feasible for such things. What else, is a better and professionally used solution. I don't know CGI? Perl?
View Replies !
Multiple Selection Lists?
i have a mutliple selection list on a form that goes like this <select name='name' multiple size=6>"; echo "<option value='one'>one"; echo "<option value='two'>two"; echo "<option value='three'>three"; etc it works fine. BUT how do u call it. For example say i selected option one and three. How do i call that on the next page so that ONE and THREE are stored.
View Replies !
Less-expensive Way To Set Up Defaults In Lists Etc?
I'm currently setting up default selections in <select> lists by passing an array of those defaults as keys ( 'valuefoo' => true ) as an argument to the function that sets up the list. Then, as I build each <option>, I call array_key_exists ( thisoptionvalue, arrayofdefaults ) to check whether to include the 'selected="selected"' string. So the code looks something like Routine ( array( 'valuefoo' => true, 'valuebar' => true ) ) ; ..... function Routine ( $defaultvals ) { for ( $i= etc. ) echo '<option....' . ( array_key_exists( 'curroptval', $defaultvals ) ? 'selected="selected"' : '' ) . etc ' ; } (I've elided a lot of syntax, but you get the idea) That seems slow and tedious. Does anyone know a cheaper way?
View Replies !
Quote's Invoices Lists...
I need someone to bounce some ideas off. This is what I'm trying to do, I want to be able to create a script that will spit out a quote based on the information filled in. The part I'm stuck on is. Entering all the items in. Ok, say I have a form, it starts off where you put in all the details (eg, who the quote is for address phone no etc.) Then there will be a list of items to go onto the quote. Now this is the part I'm stuck on. I'm thinking maybe something like an add new item button that opens a new window and then you enter in the details for each item. This then adds each item to the quote. Each item that is entered can be added directly to the database. So what I'm thinking maybe is a popup window that you fill in the details for each item, you hit submit, and then it goes back to the origional quote page, but now with the item added to the list. Maybe is there java script where you can open a new window and then refresh the parent window when the child is closed? this would then have the items listed.
View Replies !
Multiple Lists Selection
I am using a simple registration form that i made with the toolbox, but when I come to a multiple list to choose from (populated from the database) it doesn't work correctly. Of course, out of the multiple items selected only the last one gets inserted. From what I have read, the selection must be turned into an array then looped for this to work. Is this correct? Next how would I code this to work right. If you let me know which code to post, I will post it.
View Replies !
Multiple Selection Lists &
I have 2 multiple selection lists. I am using javascript so that users can select items from list 1 and move them to list 2. When the user submits the form I need my php to get the values he has/she has in list 2... I have done printf($_POST['list_2']) and it only shows one value, even when multiple are selected. I read that I need to change it's name to list_2[] but if I add the brackets to the name my javascript quits working.
View Replies !
Updating Lists On Page
The problem is that I am displaying all the rows of my table which have the value of the field 'approval' as 0. Now, there are to be 2 buttons next to each row with names "Approve" and "Disapprove". If you click on approve, then the value of 'approval' for that row becomes 1 and if you click on "Disapprove" , the value of 'approval' becomes -1. How to accomplish it ? as the list being viewed will be changing very often. Code:
View Replies !
Populating Drop Down Lists
Could anyone help me on populating database driven drop down menus. I am trying to populate a second drop down list based on the selection of the first drop down list. I have the first drop down list running. Not sure about getting the second now.
View Replies !
Making Lists Of Words
Say I save into a field of a mySql database something like "two, three, four, five, six" all within one field, and then save each individual value into a spot in an array. So my array would go somewhat like a[0]=two a[1]=three and so on. I know how to do this in Java, but not in PHP. Similarly, is it legal so write $string = five; $string = $string + ',' + 'six'
View Replies !
Dpendent Drop Down Lists
I'm making a system for outage reports, I have a field that refers to the outage type. I want when choosing from the list, for example, POP, all fields hat doesn't refer to POP issues to disappear. I made a demo with a software PHPrunner 4.1 and you can check it out. exapmle: I choose DNS so all feilds refer to POP and other issues should disappear.
View Replies !
Generating Combo Lists
Lets say I have an array: $fruitarr = array("apple", "banana", "orange", "lemon", "lime", "strawberry"); And I need to generate a list of smoothies over a period of 8 weeks. Each week only two of the fruits can be used together at a time. So for example, the choices for week 1 would be: Code:
View Replies !
Drop Down Lists And Textfields
I've found this is a great place to learn, so hopefully such can happen with the following: Basically, I'm trying to develop a world market for a text-based game wherein what is available is listed inside a drop-down list, followed by an input box where the user can enter the amount to purchase (up to the quantity amount available) and submit. Likewise, I've got a drop-down list populated via a MySQL query. Altogether, the page looks like this: My question is, how does one associate the input box with the drop-down list, assuming it's possible (which I would assume)? Currently, it displays correctly, however when one submits via the "Purcase Goods" button, nothing occurs. I'm not quite sure how to integrate everything coherently; my knowledge is limited in the area of PHP/HTML integration, so any explanation would be kindly appreciated. I know long streams of code are often unhelpful in pinpointing a problem (or problems), but in the interest of not excluding an element, here's the code of the file in question: ....
View Replies !
Putting Lists In Order
I have produced a noteboard style calendar where all events of a particular month are called and then number representing the date is shown and then the event after it. I'd like to know if possible the code which will order the numbers from the lowest to highest number. <?php function getevents($eventmonth){  $file = file("data.txt");  foreach($file as $key => $val){   $data[$key] = explode("|", $val);   $day = $data[$key][0];   $month = $data[$key][1]; ........................
View Replies !
Keeping Selection Lists
I would like to create 2 single-select drop-down selection boxes on a page box1 - select academic year from 2001, 2002 , 2003 etc box2 - select semester from 1, 2, 3 etc As a result course details for all courses that satisfy these selection values get displayed below the boxes. The boxes remain availabel on the page. The user should be able to re-set these boxes to different values to generate different results. The boxes remain visible on the page. Is this possible ?
View Replies !
MySQL Lists All The Results
I have this code which works well, it lists all the results. but in results_data i have team1 and team2 feilds. I want to add a code to this so that if either team1 or team are = to say $teamsetid then it will show the row but no others. How can this be done? PHP Code: $result = mysql_query ("select * from results_data where group_id = $latest_group_id and comp_run_id = $compid order by list_order");
View Replies !
Have 3 Lists <selectfunction In A Form.
I have a huge list of selectives in a database. What I want to do is have 3 lists <selectfunction in a form. 1 list will have countrys, another list will have citys. When a country is selected, I want the list of citys to show that is in that country, if there is no citys i want it to go straight to the 3rd list. Is this possible in php? if so do you have any examples.
View Replies !
Allowing Edits Of Lists
I want to provide users a page where they can browse entries in a database 10 at a time, for example. I am doing this as a table, where each row is a database entry. I want to be able to give the user the ability to modify entries. By either clicking on a link or a button on each row, I want the user to be sent to another page to edit that entry.
View Replies !
Showing Lists By State
I need to pull out a large list of companies out of a database for display on the web. They are listed by state, and I can sort them by state, but I need to show the state name as a heading above each state's list.
View Replies !
|