Adding Items To A List Or Menu
Not sure if it is a php question but since i am working in php here it is.
Ho can i add items to (the item label=visual text and the value=index
number) a list object on a website.
I am having a list with 4 items and i would like to add the text from a
textfield (textfield1.value) to the list object so it will hold 5 items.
View Complete Forum Thread with Replies
Related Forum Messages:
Adding List Items To A Database
Not sure if this is javascript or php so i put it in both newsgroups, sorry if it's the wrong group. I wrote (with help) a code to put several items in a list object (select) and I would like to add the items in this list to a database. I know how to add a selected item to the database but how can i put al the items tot the database. I need somekind of loop wich go's through the list.
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 !
Drop Down Menu Where The Items Are From A MySQL Select Query
I am just starting programming in PHP and wonder if it is possible to have a drop down menu where the items are from a MySQL select query. I am registering people for a weekend seminar and want to have a list of valid weekends to choose from on the form. Any pointers to scripts or PHP references that will help would be appreciated. I am using the book "Build your Own Database Driven Website Using PHP & MySQL" to get me started, but also need recommendations for a general primer to php.
View Replies !
Adding Items To An Array
I have a for loop to add items to an array, but when i use a for loop to print these items, iI only get the last item of the array. This is a simplified example of what i do, what is wrong with it: for ($i=0;$i<10;$i++) { $test=array($i=>$i); } for ($t=0;$t<10;$t++) { echo "array".$t."= ".$test[$t]."<BR>"; }
View Replies !
Adding Only Unique Items To An Array
I've made a small code snippet that adds a new item ($value = $_GET) to an array in a cookie. My main question is in the title of the post, and I have a related one: How do I delete a specific value from the array and shift all the other values down to fill its place? Will this happen on its own? And one more: Using this code I display the array values in descending order; foreach ($_COOKIE['best'] as $name => $value) { $best = urlencode($value); echo //insert code here } } Is there any way to display this in ascending order?
View Replies !
Problem Adding Items To An Array
I have been trying to learn php for the last 3 weeks or so and I have a problem I cannot work out. I am trying to create a list (shopping cart of items) which are contained within an array and which can have new items added via a form. I then just want the contents of the array to be displayed in a simple list. I can get one item to be added, but when I try to add another item, the new item just replaces the old one. Code:
View Replies !
A|B|C List Items
i have a problem trying to make a "list all" items page. So far i just have A-Z items, but for 0-9# items, i just cant make them show. Code:
View Replies !
Adding Multiple Listbox Items To Mysql
I want to be able to select multiple items from a listbox in a form and send the result to mysql blob. I only get one item to the bd. Here is part of the script. Item: <select name="itm" align="bottom" multiple size="2"> <option value="item1">item1</option> <option value="item2">item2</option> <option value="item3">item3</option> <option value="item4">item4</option> <option value="item5">item5</option> </select> "Insert into xyz set itm = '$itm'";
View Replies !
Deleting Items From A List
When i click one of the delete buttons, the form submits, but nothing happens. I'm pretty sure i'm doing something stupid with the form buttons, but I've been staring at it too long...any takers? Code:
View Replies !
Evenly List X Items
I have a mysql database in which there are x rows. I would like to evenly list these items on 3 columns. Since I don't know how many items I'll have,is there some formulas on how to come up with the number of HTML rows required to display the items evenly? Here's the structure of my HTML table. <table> <tr> <td>x1 <br /> x2 <br /> x3 <br /> x4</td> <td>x5 <br /> x6 <br /> x7 <br /> x8</td> <td>blah blah blah</td> </tr> </table>
View Replies !
Randomizing Items On A List
I'm running a third party php script and am having trouble setting the order for a list. The list (see the attached image) is divided into 2, "cat_featured" and "started" at present they are both set to the same order, with the most recent appearing at the top of the list. What I am trying to do is sort it so that the cat_featured items are sorted randomly and the "started" items are left the same (sorted by most recent first). Here is all the necessary code I think: function SetOrder($SorterName, $SorterDirection) { $this->Order = "cat_featured desc, started desc"; $this->Order = CCGetOrder($this->Order, $SorterName, $SorterDirection, array("Sorter_title" => array("cat_featured desc, title", ""), "Sorter_started" => array("cat_featured desc, started", ""), "Sorter_asking_price" => array("cat_featured desc, asking_price", ""), "Sorter_location" => array("cat_featured desc, state_province " . $SorterDirection . ", city_town", "")));
View Replies !
Dynamic List Items
I’m trying to build a multi-level unordered list from a database query. I can't figure out a good way to do this. How can I create this: Code:
View Replies !
Adding Multiple Items In Shopping Cart W/ One Click
On the product page, I have the option that if a customer would like to add extra "products", then they would click on the desired checkboxes to add what they would want and then when they click on the "finish purchase" link, they would be directed to the cart page with their selection or selections shown. Code:
View Replies !
Dynamic List Items Repeating Themselves
I'm working on this online magazine, and each page (well, other than the front page) has a menu included on the right-hand side consisting of articles divided into three sections: articles, columns, reviews. For some reason, whenever I click on one of these article links, that link takes the place of the first link in the section. You can see what I mean here: PHP for the included right_menu.php PHP Code:
View Replies !
Adding A Drop Down Menu To My Pagenation Script
I have a basic pagenation script working on one of my pages. It simply splits the info form my database and echos the data on the page. At the bottom of the page I have hyperlinked numbers. Although I would like to change the numbers at the bottom to a dropdown menu listing the page numbers. Also I would like to add a next and previous hyperlink to the script. As I am a PHP noob I am not sure how I go about this, any idea's guys? Code:
View Replies !
Can You Read A Value Into A List Menu?
a system i am developing has both a user and an admin side. The user can add a record and then the status of this is initially set to a fixed value. What I am wondering is, if i stick with a list of say 4 possible status', how can i get whatever status the admin changes the record to to be "sticky" on the menu the next time he looks at the call, as opposed to the menu showing the default value set in dreamweaver?
View Replies !
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 Replies !
Cannot Get List To Stay In Menu
I am using 2 drop down menus which pull their options from a database. Once the user selects a language and then a product a list of available pdf's are displayed. However the form resets it self. How can I set this up so the products for the language selected stays. I was thinking about using a session but im not sure how to go about that when dealing with pulling data from MySQL Code:
View Replies !
Mysql List Menu
how can I modify this code to list queries in alphabetical order and eliminate duplicate names. <?php mysql_connect("localhost", "xxx_xx", "xxxx") or die(mysql_error()); mysql_select_db("xxxx_xx") or die(mysql_error()); $query="SELECT Bloom_Name FROM ihs"; $result = mysql_query($query); echo '<select name="ihs">' while($nt=mysql_fetch_array($result)){ //Array or records stored in $nt echo '<option value="' . $nt['id'] . '">' . $nt['Bloom_Name'] . '</option>' /* Option values are added by looping through the array */ } echo '</select>' // Closing of list box ?>
View Replies !
A Form Menu List
I have a date of birth script on my website and at the moment im faced with typing in about 100 dates ranging from 1900 to 2006 is their any way i could use php to create the range of dates in a form menu list?
View Replies !
Select List/Menu Using PHP And MYSQL
Here is my code: <select name="country" class="sidelinks"> <?php do { ?> <option value="<?php echo $row_AllCountries['country_ID']." ";?>"<?php if ($row_AllCountries['country_ID'] = $acountry) { echo "selected"; }?> > <?php echo $row_AllCountries['countryname'];?></option> <?php } while ($row_AllCountries = mysql_fetch_assoc($AllCountries)); ?> </select> A few words to describe: -$row_AllCountries['country_ID'](get from MySQL) is a unique country ID number -$row_AllCountries['countryname'](get from MySQL) is the name of the country -$acountry is the country ID number that i want to be selected when the form loads I have all the values and country names named OK...the only problem is that when the form loads it selects the last country.
View Replies !
PHP / Javascript Menu List Population
I would like a web page to have 2 menu lists The contents of the second menu list depending on the selection made in the first. The contents of the second would be populated from a database. I am fairly new to programming using PHP, Javascript and MySQL but I am sure what I am asking has been done before. Could someone please give me some pointers or direct me to a tutorial.
View Replies !
Trying To Create Dropdown Menu From List
I am trying to create a dynamic dropdown select menu from a directory containing other directories and files. This is to select a certain page from the list so I can edit it. I only want the files in the menu. Here's what I have so far but it doesn't populate the dropdown. Code:
View Replies !
Calendar Type List/menu
how do i do 3 list type menu one with the 12 months next with the days in that month and the year. so want i want is when people select a month the next list show the days as soon the pick the month.
View Replies !
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 !
Populating A List/menu From MySQL
is there a way to populate a list, or a menu form using php, and MySQL? Basically i have a list, and i am planing to import 2 variables, id, and name, bouth id and name are variables loaded from MySQL (yes there are multiple id's, and name's) Name would be the label displayed, and the value would be id. Thats what i need. After that i will make a submit button, witch will post the selected id to a different file. How can i achive this? Does anyone hae any samples maybe?
View Replies !
HTML 'list/menu' And PHP/mysql
tell me the correct syntax to use for assigning the selected option from a pick-list before inserting to a mysql database? I am trying to give the visitor the option of some 20-30 categories from a pick-list and then I want to store the selected category in a field (called 'cat') in my mysql table.
View Replies !
Array List Menu Problems
I am trying to store values from a List Menu into an sql database table as an ARRAY. However, when I select the multiple values from the form, it only stores the selected values as 'Array' in the SQL table. Here is the Select Statement: <select name="NOTES[]" size="9" multiple="multiple" id="NOTES"> <?php do { ?> <option value="<?php echo $row_literarydevices['LDEVICE']?>"<?php if (!(strcmp($row_literarydevices['LDEVICE'], $row_Recordset1['NOTES']))) {echo "selected="selected"";} ?>><?php echo $row_literarydevices['LDEVICE']?></option> <?php } while ($row_literarydevices = mysql_fetch_assoc($literarydevices)); $rows = mysql_num_rows($literarydevices); if($rows > 0) { mysql_data_seek($literarydevices, 0); $row_literarydevices = mysql_fetch_assoc($literarydevices); } ?> </select> Can anyone offer a reason to why the values are not being stored?
View Replies !
Default Menu/List Option
I'm trying to create a form with three menus, each with the same values, and I have no problems there. Each menu has it's initial value set at "None" and then the rest of the values are pulled from my MySQL db. Everything works great if the user selects three values that came from the database or selects something from the first menu but not the other two and then submits. The problem is when the user doesn't select anything from the first menu. The next page reads the form value as "" instead of "None" but only for the first menu. The other three menus work fine. I know this isn't really php related, but this is usually such a helpful forum that I thought I'd post here before I start to search for some helpful html forum. Answers would be greatly appreciated, but so would corrections for my terminology (which I think I am confused about) or a good link to a place where I should be asking this question.
View Replies !
Dynamically Populated List Menu
I have a DB with a field called county in a table called info. I want to populate the list menu below with the counties in the field county. Would there be a way to get around the fact that there will be many entries with the same county and we want only 1 instance in the list menu? Code:
View Replies !
Long Strings In List/menu Boxes
Is there a way to get a list/menu box to resize as the page is resized and for any long string that is an item in the list to be spread over two or more lines in the same way as text in a table does.
View Replies !
Flat File List Style Menu
I'm trying to build a Menu Building out of flatfiling with a section to add new areas to it. The idea behind it is to have a header for each section (as the top order list item) then each one below is a link of that category. I already figured I'm buillding it with limits (20 items Max per heading) and that to do it I will simply have each Heading/links in it be a new row in the document. example row Tips tips.php Tips on Php, file tips File Tips tips/files.php, etc etc With the first item of each row being the Heading and each other being the ones under it My question is What delimiters should I use to seperate in the row (I need to separate each item by 1 delimiter and then in each row separate the href, alt, name) Secondly for rewrtiign it should I simply write it so each time it rewrites the whole file or should I try and do string replacing and do modify sorta deal.
View Replies !
Form Validation :: List / Menu In Dreamweaver
Does anyone know anyway to put in additional php coding to validate list/menu in forms? I am currently using Dreamweaver, so I am using their Validation check in their Tags/Behaviour sections. I read in alot of places that this default function does not allow a validation check for list/menu. But I am wondering if anyone know of anyway to put in some additional coding so that it will allow it to validate the list/menu as well?
View Replies !
Pull Down Menu Generating A List Off Another File
Is there a way I can make a pull down menu generating a list off another file of all the destination case coming from the file locations.php? locations.php switch ($destination){ case "Las Vegas": echo "Bring an extra $500"; break; case "Amsterdam": echo "Bring an open mind"; break; case "Egypt": echo "Bring 15 bottles of SPF 50 Sunscreen"; break; case "Tokyo": echo "Bring lots of money";...........
View Replies !
Stuck On Dropdown Menu List, Could Use Some Guidence
I have a form with some drop down list/menus. I do a check for ommissions and if found display a message to re-try. What I need is a way to show which options where chosen when the user submitted the form the first time. If someone could show me how to do the first one, I'm sure it's the same process for the second one. Here's the code:
View Replies !
Script That Is A Bit Like A Jump Menu But Without The Pull Down List.
I am looking for a script that is a bit like a jump menu but without the pull down list. I want users to be able to enter a post code (4 digits) and then be redirected to a web page based on that post code as each web page is different per code. the jump menu provided in dreamweaver is almost there but as there are thousands of codes it is impractical to have them drop down.
View Replies !
Print Array In List/menu Form Object
how i print a full column array into a list/menu form object, so that the text links to their respective page.....it is basically for a list of interviews so you click on the band name and then goto the interview page.
View Replies !
How I Can Make A List That Acts Like A Html Jump Menu?
how I can make a list that acts like a html jump menu (for a regular list I have to use a "Go" button in order to achieve the desired behaviour and jump menus I cannot use because they work only with links to other pages). For example,I want such a list filled with questions from my db and when I select one I want to see its possible answers; the page stays the same, only its data differs based on the selection. Or you can have a look at such a jump menu on this website, the one with options for geting to various sections of the forum.
View Replies !
Adding Variables To A List
I have a dropdown list that shows a lot of places and prices. Looks like: someplace - $ someprice. The users of the page selects one or more places, and i would like to show selections on the same page. And calculate the total price. And i don't quite know how to do it. I can select one by a form with a button and make it show when reloading the page, but how do I do it, if i want to select more places?
View Replies !
|