Forums / Developer / PB : collect information in a form

PB : collect information in a form

Author Message

Anthony M.

Tuesday 27 February 2007 2:02:37 am

Hi,

I want to make a contact form, but i've got a dynamic field like this :

<select name="ContentObjectAttribute_ezselect_selected_array_1636[]" id="liste_cible" onchange="">
	<option value="" selected="selected">Choisissez</option>
	<option value="145">cible1</option>
	<option value="156">cible2</option>
        <option value="157">cible3</option>
	<option value="158">cible4</option>
	<option value="159">cible5</option>
</select>

i have created a "Selection" attribute in my class, but i can't put values in this class because it can be changed by the user in the content tree...
how can i get the value of this select that the user have choosen in the form ??

Thanks a lot for your help

Anthony

Gurudutt Verma

Tuesday 27 February 2007 2:43:41 am

Hi Anthony,

try it with Option datatype ?

That should help you.

Fabrice PEREZ

Tuesday 27 February 2007 4:15:40 am

Hello Anthony,

Maybe there is a solution for your problem.
Try to put in your class a text-line attribute.

Create your select in your template (override of the attribute) , and give it the name and the id of your text-line attribute.
"ContentObjectAttribute_ezstring_data_text_".$idOfTheTextLineAttribute

Hope this helps.

Fabrice, Internethic

Fabrice, Internethic

Kévin S.

Tuesday 10 August 2010 3:49:25 am

This solution still works, and is a good alternative to selection or enhanced selection datatype if we want to have a <select></> with dynamic content (in my case, the dropdown list is filled with the name of some nodes and should be automatically updated when these nodes are edited).

But maybe there is a new proper way to do so. Does anybody know that ?

___

Kévin