473,786 Members | 2,368 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

PHP Drop down Menus

1 New Member
I don't have any issues creating drop down menus utilizing PHP and Mysql or posting that information back to the database.

My issues comes when I retrieve the records for updating purposes. The drop down menu always has the first item selected not what is in the record. For example:

User B=widgets in the record.

When I pull the record up
User B=apple.

How do I get the drop down menu to have widgets selected when I retrieve the record?

Thanks.
Oct 4 '07 #1
1 1568
Atli
5,058 Recognized Expert Expert
Hi. Welcome to The Scripts!

If you want a specific <option> of a <select> to be selected, add the 'selected' property to the <option> tag.

For example:
Expand|Select|Wrap|Line Numbers
  1. <select>
  2.   <option value="1">First</option>
  3.   <option value="2" selected="true">Second</option>
  4.   <option value="3">Third</option>
  5. </select>
  6.  
Here the 'Second' option will be selected by default.

You just need to write your PHP code so it can find the option you want selected and add the 'selected' property.
Oct 4 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
2847
by: Nanos | last post by:
For the form I need to create drop down select with say five different options. There also should be possibility to enter own option if one is not listed. How can I do it.? Thank you in advance for any hint, emanuel
3
2965
by: KK | last post by:
Drop-down menus are the hottest thing since Wonder Bread but . . . 1. Alot of people put them in the they-look-nice-but-you-cant-code-them-right-so-they-always-look-messed-up category (a la "frames"). Do you think this is true> 2. Some people think they take up too much KB. 3. Some people are worried that people who have javascript turned off wont be able to see them. What percent of web users have javascrips turned off? I thought it was...
10
3487
by: Haines Brown | last post by:
I've implemented the horizontal drop down menu discussed recently in this newsgroup, and it works nicely under Galeon and Mozilla, but not IE 5.0. Here are the problems: Under IE 5.0, the there is no drop down menu functionality at all. I wanted to implement an alternative stylesheet for IE, but my link to it is apparently broken. What is wrong with my link? I'd
0
16169
by: vikram.cvk | last post by:
Hello Experts, Im trying to design a CSS vertical drop down menu which should have the following functionality. Home About Us | -->Overview
2
3668
by: pantagruel | last post by:
I have an old web application I did where browsers with dynamic capabilities received a drop down menu on the top of the page and a fold out on the left hand side of the page and non-dynamic browsers received two static menus. This was done via server side detection of browser capabilities and branching the application. Over time needless to say the capabilities between the dynamic and static sides got seriously out of whack. Now the...
1
1678
by: Capitan Catarro | last post by:
Hi everybody, I have a little problem with drop down menus. I have a PHP page in which I extract some categories (from a database). I put those categories in a drop down menu without problems. I would like that when a category is chosen, the entire page should be reloaded without the pression of any "submit" button, and should appear a new drop down menu. The main problem is the reloading of the page as it appears not to work if, after...
3
1964
by: Andrew | last post by:
Hello, friends, I was asked to implement a .aspx page with drop down menus. When a mouse pointer moves over a menu bar, a drop down list containing sub-menus will show up. Thus a user may select a sub-menu from the list. (It is something like the menu bars on this page: http://www1.us.dell.com/content/default.aspx?c=us&cs=19&l=en&s=dhs) What is the best (simple and easy to maintain) approach to do this? Any
1
1857
by: ReGenesis0 | last post by:
I am doing drop-down menus for a site I'm developing (not my idea, neadless to say.) I have a nice robust Javascript that handles it, and it actually WORKS, works across browsers even! How unexpected! However, I have one TINY problem. In netscape, ON OCCASION, the drop-down menus will show up halfway down the page. Reloading fixes this. Resizing the windows fixes this. (It's asising, I think, because of the Mozilla...
1
2409
by: Kaland | last post by:
Do the search engines follow links that are within forms (like the drop-down menu) so that those pages are indexed? Here is the code for a sample drop-down menu that I created. <form><select name="menu" style="font-family:'Calligrapher';color:#993333;background-color:#FFFFFF;font-size:10pt;"><option value="http://www.localwebsolutions.com/local-business-marketing-online.html">Marketing Online</option><option...
0
9491
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10163
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8988
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7510
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6744
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5397
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5532
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3668
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.