Skip navigation
molaybusiness@gmail.com
Currently Being Moderated

Textbox value based on menu list selected value

May 4, 2011 5:46 AM

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

 
Replies
  • Currently Being Moderated
    May 9, 2011 4:15 PM   in reply to molaybusiness@gmail.com

    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 />

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points