mikelt4
Posts: 9
|
| Posted: 03/21/2012, 9:16 PM |
|
CCS 5, PHP 5.2, MySQL 5
fairly new to CCS. been working on this problem for the past 4 or 5 days. i've searched and reviewed and tried all of the related topics that i could find on this forum. i've tried the $Component, $this, OnChange, BeforeBuildSelect, and more.
i have a table with 3 fields, caryear, carmake, carmodel. 21,000+ records. A list of all cars and trucks available between 1941 and 2012.
i have a Search Grid with 3 drop down listboxes. s_caryear, s_carmake, s_carmodel.
the s_caryear is doing fine, my SQL code is SELECT DISTINCT caryear FROM carlist.
i make a selection in s_caryear and now my problem.
lets say i select 2011. now in the s_carmake drop down i want to see all of the cars available in 2011. for instance, i don't want to see PONTIAC in the list because there are no 2011 Pontiacs.
my SQL is SELECT DISTINCT carmake FROM carlist WHERE caryear = s_caryear.
i've hard coded this just to see if it does work, "WHERE caryear = 2011", and it does. my listbox is showing no selections because it is probably comparing to NULL or " ". i can't seem to find, or how to find the value of the selection i made in the previous listbox.
if i press the SEARCH button then i can find and see the values of my 3 selections. but, prior to pressing the SEARCH button, i can't find the values of the selections made. i'm sure it is something very simple. it's eluding me. i can breakout my NotePad and code this all up with no problems. but i can't seem to find where CCS is storing these values.
sorry for the frustration, but it's been 4 or 5 days and i'm wore out.
just don't tell me to reboot. HA
thx in advance.
|
 |
 |
ckroon
Posts: 869
|
| Posted: 03/24/2012, 1:32 PM |
|
You need to setup the second listbox as a dependant listbox.
Go to codechargetools.com and get this: http://www.codechargetools.com/product.php?product_id=2
The best $12.50 you will ever spend.
There are examples to code one by hand but the CCT version is much much better.
_________________
Walter Kempees...you are dearly missed. |
 |
 |
|