How do you write a <select> statement to write to a string field rather than using enum.

Author Message

Stuart Fenton

Wednesday 04 February 2004 5:45:06 am

{literal}

I don't want to use the enum field to enter data from a <select> statement. How can I do this?

I presume I do the following but I can&#8217;t find any documentation on it and it's hard to work out the correct syntax from the other <select> statements in the code.

<input type="hidden" name="ContentObjectAttribute_id[]" value="{$ContentObjectAttribute:item.id}" />

<select name="ContentObjectAttribute_id[]" >
<option value="Female">Female</option>
<option value="Male">Male</option>
</select>

Any help would be great.
Thanks
Fats.
{/literal}

--- Actually I figured it out (but I couldn't post a reply to my question so I adding it here)

----
Here is the correct code in case anyone needs it.

<select name="ContentObjectAttribute_ezstring_data_text_{$ContentObjectAttribute:item.id}" >
<option name="ContentObjectAttribute_ezstring_data_text_{$ContentObjectAttribute:item.id}"
value="Female"
{switch match=$ContentObjectAttribute:item.data_text}
{case match="Female"}selected{/case}{case}{/case}
{/switch}>
Female
</option>
<option name="ContentObjectAttribute_ezstring_data_text_{$ContentObjectAttribute:item.id}"
value="Male"
{switch match=$ContentObjectAttribute:item.data_text}
{case match="Male"}selected{/case}{case}{/case}
{/switch}
>Male
</option>
</select>

Fats.

-- Stuart

stuart@grandmore.com
http://www.grandmore.com

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 31 2025 06:14:54
Script start
Timing: Jan 31 2025 06:14:54
Module start 'layout'
Timing: Jan 31 2025 06:14:54
Module start 'content'
Timing: Jan 31 2025 06:14:55
Module end 'content'
Timing: Jan 31 2025 06:14:55
Script end

Main resources:

Total runtime0.8058 sec
Peak memory usage4,096.0000 KB
Database Queries46

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0050 588.6172151.2734
Module start 'layout' 0.00500.0020 739.890636.7578
Module start 'content' 0.00700.7980 776.6484869.9766
Module end 'content' 0.80500.0008 1,646.62507.7344
Script end 0.8058  1,654.3594 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.4109160.0002
Check MTime0.00120.1512160.0001
Mysql Total
Database connection0.00060.080510.0006
Mysqli_queries0.761294.4602460.0165
Looping result0.00040.0437440.0000
Template Total0.777596.520.3887
Template load0.00220.266920.0011
Template processing0.775396.211720.3877
Template load and register function0.00120.146210.0012
states
state_id_array0.00130.164610.0013
state_identifier_array0.00120.146920.0006
Override
Cache load0.00180.2248360.0001
Sytem overhead
Fetch class attribute can translate value0.00050.064810.0005
Fetch class attribute name0.00160.194120.0008
XML
Image XML parsing0.00040.051710.0004
class_abstraction
Instantiating content class attribute0.00000.000420.0000
General
dbfile0.00080.0975160.0000
String conversion0.00000.000740.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
5content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 13
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs