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

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 05:22:14
Script start
Timing: Jan 18 2025 05:22:14
Module start 'layout'
Timing: Jan 18 2025 05:22:14
Module start 'content'
Timing: Jan 18 2025 05:22:14
Module end 'content'
Timing: Jan 18 2025 05:22:14
Script end

Main resources:

Total runtime0.0156 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0049 587.9219152.6250
Module start 'layout' 0.00490.0029 740.546939.4453
Module start 'content' 0.00790.0058 779.992289.4609
Module end 'content' 0.01370.0019 869.453134.3047
Script end 0.0156  903.7578 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002616.6265140.0002
Check MTime0.00127.4899140.0001
Mysql Total
Database connection0.00053.491810.0005
Mysqli_queries0.002817.635930.0009
Looping result0.00000.108310.0000
Template Total0.00159.810.0015
Template load0.00085.135610.0008
Template processing0.00074.617110.0007
Override
Cache load0.00063.633610.0006
General
dbfile0.00127.982480.0002
String conversion0.00000.051840.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs