Monday 25 May 2009 10:40:13 am
Hi, i have an feedbask-form content class that contain an field with an datatype selection and other fields "datatype (text line,courriel, integer,...)" . but when i submit the form , the field with the datatype "selection" are empty. why this behavor? the code of the ezselection.tpl is :
{* DO NOT EDIT THIS FILE! Use an override template instead. *}
{default attribute_base=ContentObjectAttribute}
{let selected_id_array=cond( is_set( $#collection_attributes[$attribute.id] ), $#collection_attributes[$attribute.id].content, $attribute.content )}
{* Always set the .._selected_array_.. variable, this circumvents the problem when nothing is selected. *}
<select name="{$attribute_base}_ezselect_selected_array_{$attribute.id}[]" {section show=$attribute.class_content.is_multiselect}multiple{/section}>
{section var=Options loop=$attribute.class_content.options}
<option value="{$Options.item.id}" {section show=$selected_id_array|contains( $Options.item.id )}selected="selected"{/section}>{$Options.item.name|wash( xhtml )}</option>
{/section}
</select>
<input type=hidden name="{$attribute_base}_ezselect_selected_array_{$attribute.id}" value="{$Options.item.name}">
{/let}
{/default}
think in advance.
The theory is when we know everything and nothing works.
The practice is when everything works and nobody knows why.
If the practice and theory are met, nothing works and we do not know why.
Albert Einstein
|