Filtering Selection In Multiple Drop Down Boxes
I want to allow a user to conduct a search on a database using multiple drop down boxes. On the first page they will have a drop box filled with records from field A. Once they select which one they want, a second drop down box will then appear with records from field B which are present for field A (a filter).
What I want though is that the first dwon down box still appears on the second page, but shows the record that the user selected. What is happening now is that when the second page comes up, the first box shows the default selection rather than the selection that the user chose. My code for the drop down boxes is: PHP Code:
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Drop Down Boxes Change By Selection
what i'm trying to do is when a user selects a country say UK, all the uk states are displayed in another selection box below BUT if the US is selected all the us states are shown, this is on nion every friends/dating site just curious as to how this is done.
Multiple Drop Down Boxes
I want to create two multiple drop down boxes, the first will display all the company names, once this has been selected all the stock information for that company will appear in the second drop down boxes.
Dynamically Filling Selection Boxes
I was wondering if anyone knows how to fill a selection box with different values depending on a selection made in a nother selection box in the same page. I dont know if what I'm tryin to do can be done or not, at least in PHP. First a quick background: We have a number of projects running right now, each of which is subdevided into various tasks. Now, I've got two selection boxes. The first contains a list of all current projects. What I want to do is this: when someon selects a project from the first box, I'd like the second box to be filled with a list of the tasks that have been assigned tot hat project.
Selections On Dropdown Selection-boxes
I have a article manager script that im nearly done with and when you press save, it takes you to another page to check that you have entered the required fields by checking for the POST vars, if not it redirects back to the page and stuffs the entered fields into GET vars header( location: file.php?errors=$errors&var1=$var1 ) 's you back to the previous page. Now i have no trouble reshowing the entered info in regular text fields as i grab it from GET but i dont seem to be able to reshow a drop down box selection it always reverts back to the first option when i redirect the page.
Form Drop Down Boxes
I have a bunch of products i want to add to a database, i have a form to submit the products to the database. What i need to crack is to have a drop down box for category 1 (beer or wine) and then automatically populate the drop down box for category 2 depending on the first selection if cat1 = beer then cat2 options = Lager, Malt, Stout. if cat2 = Stout then cat3 = Guiness, london, Old boot. if cat3 = Guiness then cat4 = Bottle, Can. I have four sub categories so need this to work on the fly before adding all info to the database ...
Drop Down Answer Boxes
how to insert drop down answer boxes (like the oes you get in questionnaires) into my cong, i can't seem to get the coding right or make anything appear in the box.
Generating Drop Down Boxes From Mysql
i'm using php with mysql. i need to be able to extract items out of my database and put them into a drop down box so that the data is dynamic. In this example, i need to get all of the names from the name.office field into a drop down box to be used in further scripts/processess. <html> <head> </head> <body> <? $db = mysql_pconnect ("localhost", "XXXX", "XXXXX"); if (!$db) { echo "error: could not connect to database. please try again later"; exit; } mysql_select_db("XXXXXXX"); $query = "select name from office"; $result = mysql_query($query); $num_results = mysql_num_rows($result); $row = mysql_fetch_array($result); ?> </body> </html>what goes here??? i have tried many things and not been able to get it to work.
Dynamic Dependent Drop Down Boxes
I need to build a dynamic page with 2 drop down boxes on it where the contents of the second drop down box are dependent upon the selection made in the first drop down box (the first box contains districts/regions and the second box contains towns/cities). The customer wants this to happen on a single screen but can this be done with PHP?
Dynamic Drop Down Boxes With Php Query
I need to build a dynamic page with 2 drop down boxes on it where the contents of the second drop down box are dependent upon the selection made in the first drop down box (the first box contains districts/regions and the second box contains towns/cities). The customer wants this to happen on a single screen but can this be done with PHP? The above question is already answered by many people and they want me to use Javascript. My doubt is the second box shoud query the list from a table in mysql using php. How do i do that?
Dynamic Drop Down Boxes With Mysql
I'm working on a database project for a class and am having problems populating select boxes with a field from a mysql table. The first thing that I'm trying to do is pull the field LastName from the table Faculty. Then when the user selects the faculty member in the drop down box, it will then display all of the fields related to that faculty member...first and last name, title, office number etc and allow the user to edit those fields and then resubmit them to the database. However I can't seem to get the drop down box to populate, so if anyone has any suggestions as to how to fix this I would love to hear them. Code:
Remember Drop Down Box Selection
Is there a better way to do it than i currently am using? Simply echos the value in the selected option that will otherwise be blank, so this makes it impossible for the user to select no input. Code:
Drop Down Boxes Selecting Selected Option
I have this code to allow me to get the selected option selected in the dropdown. The option is stored in url variable the code i currently have is selecting everything. I am doing something wrong? Code:
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).
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
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
Autopopulating Drop Down Not Saving Unless A Selection Is Made
I have a form that autopopulates and allows user to make changes where necessary. In this form are some drop down menus (hardcoded on the page). All the selections (50 states for example) are there. If I select a state it will then post to the database. If I don't select a state and just leave it as the previously selected state (not change the selection already made by a user) it puts a blank in the database. Examples: The <?="$rest_state_pr"?> will pull the state the user selected previously. If I change the slelection it saves the new selection, but if I leave it as the "default" It puts a blank in the database. 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.
Populate A Drop Down List In A Form On The Basis Of A First Selection
I have developed a form to register a property in a db. The form needs the selection of a country and then based on that selection the selection of regions from the selected country. I have a program which allows selection of a country and then a region but it uses java script which I would like to avoid. I also just wanted one submit button if possible. Code:
Multiple Multiple Select Boxes
I'm looking to have multiple multiple-select-boxes on a page. But I can only get the contents from the last selected value within a box, via PHP. I've tried numerous methods. What am I doing wrong? You can see ALL the values present in the url: http://myserver/test.php?notify_use..._updcats=Update e.g.......
Multiple Selection
I have a form that grabs reords from a mySQL database and presents the information in a nice pulldown menu. The client now wants that little menu to be a list that you can select multiple resords from (this is a brochure request for - the list has a max of 12 pieces). I know how to get the form to look the way I want, but when I parse the form with the little app I wrote in PHP that varifies the data entered, checks feilds, and then enters it in a mySQL database for tracking purposes - there is only one record in the database - even though there were more that one records selected. Now I am simply entering $properties (the variable of the menu feild) in the the INSERT statement of my database query - do I need to parse the records selected first - what am I doing wrong...?
Handling Multiple Check Boxes
I have a PHP generated page which displays X many records. Each record has a checkbox preceding it. The user checks several checkboxes, and hits a delete button. All the corresponding records will be deleted. But I'm running into difficulty... Right now the NAME property of each check box is the primary key of the corresponding record. Hence if I know which checkboxes are checked, I simply use DELETE using the NAME value. Generally speaking, how do I get the server side to see which check boxes were checked? The check box names may not be sequential, if any records have been deleted previously, and the first check box might be a number greater than 0. Is there an easy mechanism to do this? Some kind of built in cnotrol array allowing me to loop over every check box that was on the form submitted? I could store the last and first checkbox number in a hidden input, then loop starting/ending at those values, but that may loop over a lot of controls that do not exist.
Getting Multiple Selection Into One String
I have a listbox with 5 options. I have set it up to be able to choise more than one option. What I need to know is how to get all the selection into the one string that is stored in the DB It is easy to get the first selected option to post into the DB.
Multiple Selection Form
I have made a multiple selection form, but when I select more than one option, it still only returns one. PHP Code:
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.
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.
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.
How Can I Print Out Multiple Text Input Boxes?
How Can I Print Out Multiple Text Input Boxes. The function below prints out three text boxes. The code below is static, cannot accept user input, and therefore cannot be changed. What I need to do is write a function or maybe a class that can accept user input and print or echo a different number of text boxes, depending on the user input. The name variable for each of the textboxes needs to have a different name. For example, the name for the first text box would be something like "name=textfield1", the second would be "name=textfield2", and so forth. PHP Code:
Multiple Drop Down Search
i created two dropdown lists. One lists the months. And one lists the years. I want to be able to populate a sql query with the choices the user makes in the dropdown to display the correct choices. PHP Code:
Multiple Selectiosn From Drop Down
I have a drop down box that I want people to be able to choose one or more of the options (multiple selection). How do I make mysql recognise this and add all entries into the table.
Multiple Dynamic Drop Down Population
I have a table with 3 pieces of data that I would like to use to dynamically populate 3 drop downs using javascript. The fields are state, orgname, office. If it's not already obvious, I'd like orgname drop down to change when a state is selected and I would like office drop down to change when an orgname is selected. I can do this with multiple tables but am having difficulty getting it to work when the data is in the same table. Below is the code to get state and orgname from separate tables(the code reflects one table and is broken in the below state). It's the best I can come up with and I can see why it doesn't work but I know there must be a way to pull all the pieces from a single table. <code> $list=$_SESSION['list']; if(isset($list) and strlen($list) 0){ $quer=mysql_query("SELECT DISTINCT orgname,org_id FROM organization WHERE state=$list ORDER BY orgname"); }else{$quer=mysql_query("SELECT DISTINCT orgname FROM organization ORDER BY orgname"); } $quer2=mysql_query("SELECT DISTINCT state FROM organization ORDER BY state"); //first drop down echo "<select name='state' onchange="reload(this.form)"><option value=Ɔ'>Select one</option>"; while($state = mysql_fetch_array($quer2)) { if($state['org_id']==@$list){echo "<option selected value='$state[state]'>$state[state]</option>"."<BR>";} else{echo "<option value='$state[state]'>$state[state]</option>";} } echo "</select>"; //next drop down echo "<select name='org'><option value=''>Select one</option>"; while($org = mysql_fetch_array($quer)) { echo "<option value='$org[org_id]'>$org[orgname]</option>"; } echo "</select>"; </code>
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:
Multiple Drop Down's For Search
I am looking at adding a search section to my site whereby visitors select from two drop down menu's and the desired page is displayed. Similarly to many friend finder sites whereby you can select the age,sex and country of the person you are searching for. Is there a way to do this without needing a database ?
Multiple Drop Down List Problem And MySQL
I am trying to populate around 30 drop down lists via a single query to a mySQL database. The problem is how to make sure that each drop down list only display it's relevant data. for example the table is as follows:
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 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.
Filtering HTML With PHP
I am using PHP to set up a message board which interfaces with a mySQL database. I am trying to filter malicious HTML code that users would try to leave on the message board. I want to strip all HTML tags except the <A HREF> tag.
Filtering Out Bad Input
I am currently building a website, with a built in news and comment, so far i know have been able to filter out thing such as swear words, however is it possible to filter of say f someone held down the ===================================================== ============= key Is there a way to prevent this or will i have to have some sort of statement that counts how many times the = or other char is grouped together?
Filtering RSS Content
I need to install an rss aggregator on a website. The catch is that it should only pull in items from feeds which contain certain keywords. Any idea how this can be done or if such a content managing software already exists?
Dirty Filtering
does any one has a list of dirty words, do not post in this forum, but show me url. PHP Code:
Username Filtering
I'm having problems with regular expressions. How could i check if a variable has only letters and numbers in it?
Price Filtering
I am having an issue with filtering price from a form variable so maybe someone can tell me how I'm screwing this up. I have a search page that has 3 criterias for search - category 'cat', price 'price' and location 'area'. I am using Dreamweaver 8 for this project. I can create the query for both cat and area for the double filter, but when i get to price it removes all the records from view. I removed the 2 working queries and am now focusing on the 'price' query. My SQL looks something like this: Code:
Filtering Data
I've got a question which is more aimed at drumming up some opinions/starting a discussion then looking for a "right answer". I am writing an application and I wanted to hear some suggestions on how to handle the filtering of data from the user. The data is all coming in through one class where it is then passed as arguments to methods down the hierarchy, so it seems to make sense to do the checking at that top point. However what isn't as clear is whether the regular expressions (or some alternative) used should be exclusively set by the top level class. For instance I see that Cake (a framework) has a protected _validation array which Models can set with their own regex. I am not a huge fan of this approach because it leaves the array protected, and because it may be responsibility that goes past the role of the class. In fact I'd prefer a method which didn't rely so heavily on regex in the first place as I find regex hard to maintain. So what solutions have you come up with to handle input? I'm looking for suggestions which are flexible enough to accomodate unforseen changes in security, but simple enough to be implemented in a single class (or a single method). To kick this off here's my current solution (somewhat described above) if (!is_array($this->_validation)) throw new Exception("Unable to validate data bad validation hash found"); $result = array(); foreach ($arguments as $key => $value) { $pattern = $this->_validation[$key]; if ($pattern == null) throw new Exception("The submitted data has no corresponding pattern and can not be evaluated"); if (!preg_match($pattern, $value)) throw new Exception("The submitted data was invalid"); $result[$key] = $value; } return $result;
IP Filtering By Country
Does anyone know of some good ways to filter traffic by country? I can only monetize US, UK, and Canada traffic, but must send them to a different thing for each country. All other countries I would like to send somewhere else.
Filtering XML Results
I'm in the process of creating a page that displays multiple lines of inventory for a bunch of products (let's call them 'widgets'). The widgets are listed in XML format (they'll end up being pulled from a MySQL DB eventually). Code:
Filtering Of Characters
Does filtering of certain characters make a search engine more efficient? Speical characters such as ~!@#$%^&*()_+
Error Filtering Bad Language
I have a dynamic shout box service, and I need to filter bad language, so i wrote a function on how it should work. PHP Code:
|