473,508 Members | 2,477 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Converting dropdown list value to label option

119 New Member
Expand|Select|Wrap|Line Numbers
  1. <select name="file2product">
  2. {foreach key=key_data item=item_data from=$FILE_PRODUCTS_SELECT}
  3. <option value="{$item_data.orders_products_attributes_id}">{$item_data.products_name}
  4. </option>
  5. {/foreach}
  6. </select>
I just want to display this drop down list to label option, can any one help me please !!

Thank you
Nov 11 '08 #1
8 3908
r035198x
13,262 MVP
Not sure what you want to do here. A drop down list contains many values. A label has only one text value. How do you want to 'convert' the drop down to the label?
Nov 11 '08 #2
phpmagesh
119 New Member
Not sure what you want to do here. A drop down list contains many values. A label has only one text value. How do you want to 'convert' the drop down to the label?
Thank you for your response, Actually in this drop down list there will be list like this
product1(sub_product name1),
product1(sub_product name2),

so far what i have did here is i removed that sub product name from the option, just displaying the main list.

problem is same name repeating in the dropdown list, thats why i would like to display the value in lable

i m sure that you understood my problem..

thank you,
Nov 11 '08 #3
nathj
938 Recognized Expert Contributor
Nope, not sure I do understand the problem.

Are you after some sort of AJAX style feature? The user selects the option from the dropdown list and then the next control takes the selected value as a label?

That's fairly straight forward using JS or AJAX, but as I'm not sure that's what you want I won't supply any code as it may be a waste of time.

If we could see your code in code tags then we may be able to hazard a guess at what you are after. Also please let us know what the code is doing or not doing that does not match up with the intended purpose.

Cheers
nathj
Nov 11 '08 #4
Markus
6,050 Recognized Expert Expert
Magesh, it makes code easier to read for our experts if you use [code] tags. Please read the Posting Guidelines if you are unsure how to do this.

Markus.
Nov 11 '08 #5
phpmagesh
119 New Member
Magesh, it makes code easier to read for our experts if you use [code] tags. Please read the Posting Guidelines if you are unsure how to do this.

Markus.

hai,

I am new to to this forum, i dont know what is Code tags, can you tell me how to send coding using code tags please..

Thanks in advance,
Nov 12 '08 #6
Markus
6,050 Recognized Expert Expert
hai,

I am new to to this forum, i dont know what is Code tags, can you tell me how to send coding using code tags please..

Thanks in advance,
Posting guidelines

Please read the Posting Guidelines if you are unsure how to do this.

Markus.
Nov 12 '08 #7
natznetznitz
8 New Member
.i have the same problem.. i have a working drop down list that displays values from the sql database, now i want the value selected in the drop down to be assigned to a variable and be used to the next form..i dont know how it works..anyone help?
Feb 6 '11 #8
nathj
938 Recognized Expert Contributor
Hi,

I'm still not sure I understand the problem scope here but I'm still keen to help out. If you take a look at http://www.biblegateway.com/ They have a drop down list on the first page that allows you to select Bible rasnlation and language. Take a look at the source for that list using FireBug and see if it is what you are after.

If this is what you want and you want to build this up using code and data from a database then you will need to develop some business logic to do that. If this is the desired output seeing how it should look should help you define the code to build it.

If you get stuck with that code then please post what you have a I'll try to help out.

Thanks
nathj
Feb 7 '11 #9

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

Similar topics

1
8256
by: Joseph Barron | last post by:
Here is a SIMPLE problem that I'm trying to solve. It works in Netscape 6.2, but IE6 gives ""No such interface supported." Below are page1.htm and page2.htm . In page1.htm, there are two...
6
3452
by: passion_to_be_free | last post by:
This is probably simple, but I can't seem to find it anywhere. I have have some values stored in javascript variables. I have a <select> dropdown list whose options correspond to these values. I...
1
10166
by: Ian Davies | last post by:
Hello In a php file I have a drop down list with index numbers in whos default value is feed into an sql query that filters records from my database and displays them in an html table. Trouble...
0
1366
by: Manish | last post by:
Hi All, I'm having this problem I hope someone can help provide a solution for it :) I've this dropdown list box in a usercontrol which I'm populating from the database (it's viewstate property...
2
1108
by: Wong CS | last post by:
Dear all, i hav a problem when i compile my web application... this is the SQL query i used to insert my data into database. string InsertBuyerDetail = @"INSERT INTO Buyer (Buy_Login,...
1
1471
by: bobf | last post by:
I have successfully linked 2 dropdown lists, but then I got greedy and wanted to provide the same information to further dropdown boxes. What I am trying to do is to select a client and then offer...
3
2779
by: John | last post by:
I have two dropdown lists that I have bound to a datatable and set the DataTextField and DataValueField for. Both lists show the values I expect from the database. However, when I need to access...
0
5943
Soniad
by: Soniad | last post by:
Here I have created simple dropdown list that shows months for every year. U can initialize the year from where u want to start. I have started from year "1999". Similarly, U can use Following...
1
1439
by: bappadiit | last post by:
I am not sure that what I name it but here is the details of what I want to do: There will be two or more dropdown lists, suppose first one contains faculty name and the 2nd one is course name....
0
7231
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,...
0
7133
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...
0
7336
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7066
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5643
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,...
0
4724
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...
0
3198
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
773
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
435
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...

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.