473,669 Members | 2,514 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

drop down blank?

1 New Member
Hi I am new to PHP and I have a little problem

I have created a user registration form and on this form I have three drop downs one for title, prov/state and country. This creates a record in the database but when I create an edit user profile page and display the record I have a problem the record displaying correctly and I have tested the output but I cannot get the dropdowns to display the variable from the database



<select name="title" size="1" id="label">
<option selected="selec ted" value="Mr"><?ph p if (isset($_POST['title'])) {echo $_POST['title'];} else {echo "Mr";} ?></option>
<option value="Mrs">Mrs </option>
<option value="Ms">Ms</option>
<option value="Dr">Dr</option>
</select>

And I have the record being read from the database but the dropdown are always blank! I have tried to put the variable in the selected value but then when I submit the form it fails saying the field is empty (even though it is in the field)

My question is how can I display the record from mysql in drop downs and have it work when I submit the form after user has edited that field

Thank you
Jan 6 '07 #1
1 1366
ronverdonk
4,258 Recognized Expert Specialist
Your code snippet does not show uw how you get your data from the database, nor does it show anything that looks like populating it with db values.
Please show all the code that gets the data from the db. (enclose code within php, code or html tags!!)

Ronald :cool:
Jan 6 '07 #2

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

Similar topics

2
11038
by: ehm | last post by:
I am working on creating an editable grid (for use in adding, deleting, and editing rows back to an Oracle database). I have a JSP that posts back to a servlet, which in turns posts to a WebLogic SFSB and, from there, to the database. On the front end, all cells appear as text fields. However, for certain cells, when the user clicks on the cell, the text field turns into a drop-down field (i.e. Select object), defaulting to the value...
10
3467
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
1
1472
by: Paul M | last post by:
Hi folks, When I set the datasource of a dropdown list and bind it, the drop down list always defaults to the first item in the list. I need it to default to Nothing or NULL or whatever it is now in .NET. The situation I've got is a group of combo boxes that interelate. So if you select item 1 from drop down A, you are prompted to select an item in drop down B and if you select item 2 from drop down A you are prompted to select an...
3
1308
by: Wayne Dyer | last post by:
I can duplicate this, so I know it's not something I'm imagining and wonder if anyone else has seen it. Take a page, put a drop down control on it, hook up the onChange event handler to go get some data in the postback based on the selected index that takes 3-4 seconds to return. While the postback is occurring, click on the drop down box and *leave it open* while the postback returns.
1
1631
by: Big E | last post by:
I'm using ASP.Net and SQL Server. I have a drop down list that populates from a table. When the form opens the drop down list is full of data. I would like the drop down list to not show a default value which is usually the first text depending on the sort order in my table. I would like my drop down list to show no values until the user selects the drop down list. Thanks.
0
1509
by: thebison | last post by:
Hi all, I hope someone can help with this relatively simple problem. I am building a timesheet application using ASP.NET C# with Visual Studio 2003.As it is only a protoype application, my database has been made in MSDE. My question is simple, on my Projects form I have a 'search' button, which when clicked re-binds a datagrid with a RowFilter based on a number of user-input parameters. Two of these parameters are drop-down
7
2432
by: callawayglfr | last post by:
I am building a database in access where I have a drop down box that relates to a text box, that part I have working but when someone selects information from the first drop down I need it to limit the second drop down to just the related information. Explaining this is obviously challeging. So I'll try to draw a picture: (drop down 1) Select number --- once selected description is populated in text box (drop down 2) based on first...
1
2013
by: Basket61 | last post by:
I need to use a drop down box based on table Color that, once you click on a value, populates the field in my form In the main database design, I reference the Table Color, both the ID and the description. For the description field, I ran the lookup wizard, refering to the Table Color, Selecting just the Color field (not the ID). The display control is a combo box (default by access), with row/source type of Table/Query, and row source ...
2
1444
by: ajaymohank | last post by:
Hello friends.......... i have 3 dropdown in my project, in which 3 of them are linked with each other. ie.... i select a value from the 1st drop down and based on that value, the corresponding values will be displayed in the 2nd drop down and based on the value selected from the 2nd dropdown the corresponding value will be displayed in the 3rd dropdown. the problem is that in my page ,there are textboxes for entering name,date,phno...
0
8466
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8810
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
7410
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
6211
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
5683
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
4387
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2798
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2035
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1790
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.