Converting dropdown list value to label option

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • phpmagesh
    New Member
    • Nov 2008
    • 119

    Converting dropdown list value to label option

    Code:
    <select name="file2product">
    {foreach key=key_data item=item_data from=$FILE_PRODUCTS_SELECT}
    <option value="{$item_data.orders_products_attributes_id}">{$item_data.products_name}
    </option>
    {/foreach}
    </select>
    I just want to display this drop down list to label option, can any one help me please !!

    Thank you
    Last edited by Markus; Nov 11 '08, 12:20 PM. Reason: added # tags
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    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?

    Comment

    • phpmagesh
      New Member
      • Nov 2008
      • 119

      #3
      Originally posted by r035198x
      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_pr oduct name1),
      product1(sub_pr oduct 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,

      Comment

      • nathj
        Recognized Expert Contributor
        • May 2007
        • 937

        #4
        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

        Comment

        • Markus
          Recognized Expert Expert
          • Jun 2007
          • 6092

          #5
          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.

          Comment

          • phpmagesh
            New Member
            • Nov 2008
            • 119

            #6
            Originally posted by Markus
            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,

            Comment

            • Markus
              Recognized Expert Expert
              • Jun 2007
              • 6092

              #7
              Originally posted by phpmagesh
              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

              Originally posted by Markus
              Please read the Posting Guidelines if you are unsure how to do this.

              Markus.

              Comment

              • natznetznitz
                New Member
                • Feb 2011
                • 8

                #8
                .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?

                Comment

                • nathj
                  Recognized Expert Contributor
                  • May 2007
                  • 937

                  #9
                  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

                  Comment

                  Working...