[FX.php List] Conditional value lists with PHP and FileMaker
Tim 'Webko' Booth
tim at nicheit.com.au
Wed Nov 19 15:41:37 MST 2008
>
>
> However, because the values are not unique in the table, the value
> list is showing up with multiple values for the same district. I may
> need to see if I can get the FileMaker database re-structured to
> eliminate the duplicate values in the current table. I think the
> complicated way I created the array previously filtered it for
> unique values only.
If you've sorted the results, then you can compare the previous value
to the next to see if it should be written into the drop-down. This is
example from one one of my systems with the same issue (well, it's
actually deliberate in this one, as I'm getting a drop-down of
available lengths compared to diameters)
$lengthDupe = "";
foreach ($thelengthData as $key => $value) {
if ($value['Length_mm'][0] != $lengthDupe) {
$lengthOut .= '<option value="'.$value['Length_mm'][0].'">'.
$value['Length_mm'][0].' mm</option>';
$lengthDupe = $value['Length_mm'][0];
}
}
Also, I've done something very similar at http://www.pleatco.com/search/search.php
(which is where the code above is from) for the Dimensions search -
I use LAJAX for the call on the fly. Let me know if you want more info
about that technique.
Cheers
Webko
More information about the FX.php_List
mailing list