2 Replies Latest reply: May 9, 2011 8:00 PM by molaybusiness@gmail.com RSS

    Textbox value based on menu list selected value

    molaybusiness@gmail.com

      Hi experts,

      i am wodering what is the best way to have a textbox assigned a value based on a listmenu selected value.

       

      i have the following tables

      ID / item / color / price

      1 / item1 / red / 5$

      2 /item2/ green / 2$

      .

      .

      .

      .

      10/item10/purple/10$

       

      i have a listmenuwith all items listed.

       

      and i have 2 other textboxes that should get the color and prices respectiveley..

       

      How can i do that. ?

       

      thanks

        • 1. Re: Textbox value based on menu list selected value
          cfwild Community Member

          Hi,

           

          Lots of potential options.

           

          1).  Keep it simple.  Put the information all in the one text box, just like you have it on the posting:  Men's Polo Shirt - XL - Red - $29.99.

           

          2).  If you have the same item with lots of colors, navigate them to the Men's Polo Shirt page, then you only need XL - Red - $29.99.

           

          3).  If you only have a few options and they're going to be fairly static, a javascript script would do a very nice job.

           

          4).  If you have a lot of items, I'd suggest using a query to populate the initial select box, then use the "bind" function via a cfc to populate the other two boxes.  You'd simply put the ID in the sql WHERE clause as ARGUMENTS.ID then return the fields you need.

           

          select ....

          from ...

          where ...ID = ARGUMENTS.ID

           

          <cfwild />

          • 2. Re: Textbox value based on menu list selected value
            molaybusiness@gmail.com

            Thank you for your help.

             

            Sent from my iPhone