[Date Prev][Date Next][Thread Prev][Thread Next][Interchange by date
][Interchange by thread
]
[ic] Form - setected problem
Hello,
here is a small part of code for generating drop down box depending on
"genre" of each product.
1 product can have 1 to 10 "genre"s.
I like to build a page for the UI/admin givind adm. the ability to
update/add "genre" for each product.
The code bellow works find except the correct "genre" is/are not selected.
I absolute don't understand what's wrong here.
[query list=1 prefix=outer sql="SELECT genre_id
FROM produits_genres
WHERE sku = '[cgi item_id]'"]
[calc]
@genresarray = split(/,/,
'[outer-param genre_id]');
$out = '';
foreach $option (@genresarray) {
$out .= ($out) ? ",'$option'"
: "'$option'";
}
return '';
[/calc]
<select name="[outer-param genre_id]" size="5">
[loop prefix=inner
option='[outer-param genre_id]'
search="
st=sql
fi=genres
ra=yes
rf=genre_id,genre_nom
"]
<option value="[inner-param genre_id]"
[selected name="[outer-param genre_id]" value="[outer-param
genre_id]"]>[inner-param genre_id] - [inner-param genre_nom]</option>
[/loop]
</select>
[/query]
When somebody can help me ??
The final idea is to build "something" wich can easy be add to interchange.
The main features is giving the ability for a product to have one or
more qualities. Those qualities can be shared between products.
Alain