Specify null in a select statement

Author Message

James Packham

Tuesday 02 March 2004 8:54:16 am

Hi,

I'm trying to specify a null option inside a select statement:

<select name="{$attribute_base}_ezselect_selected_array_{$attribute.id}[]" {section show=$attribute.class_content.is_multiselect}multiple{/section}>

<option value="">Please choose a region</option>
......... Other options ..........

I want it throw a validation error because this is a required field (I've set it so in the class definition). But even though I've tried things like "null", "NULL", NULL, , ... I can't seem to get it to work :( Anybody got any advice? Is there an easy way to achieve this? (This is a single select)

Thanks,

James

Paul Forsyth

Tuesday 02 March 2004 9:12:14 am

I had a quick look at the ezselection code and it seems you are out of luck :( The datatype code doesn't do any validation of the data. To do this you will need to modify the file:

kernel/classes/datatypes/ezselection/ezselectiontype.php

paul

James Packham

Wednesday 03 March 2004 1:25:26 am

Thanks Paul,

I'll have a look at that and post anything I find out :)

Cheers again,

James

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 19 2025 04:40:36
Script start
Timing: Jan 19 2025 04:40:36
Module start 'layout'
Timing: Jan 19 2025 04:40:36
Module start 'content'
Timing: Jan 19 2025 04:40:37
Module end 'content'
Timing: Jan 19 2025 04:40:37
Script end

Main resources:

Total runtime0.9198 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0046 589.2578152.6250
Module start 'layout' 0.00460.0031 741.882839.4453
Module start 'content' 0.00770.9108 781.3281501.7109
Module end 'content' 0.91860.0012 1,283.039112.1563
Script end 0.9197  1,295.1953 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00290.3124160.0002
Check MTime0.00120.1319160.0001
Mysql Total
Database connection0.00070.077210.0007
Mysqli_queries0.874895.1109570.0153
Looping result0.00060.0626550.0000
Template Total0.894097.220.4470
Template load0.00210.223220.0010
Template processing0.892096.972820.4460
Template load and register function0.00010.011610.0001
states
state_id_array0.00120.133710.0012
state_identifier_array0.00060.069720.0003
Override
Cache load0.00160.1716220.0001
Sytem overhead
Fetch class attribute can translate value0.00080.087120.0004
Fetch class attribute name0.00150.164140.0004
XML
Image XML parsing0.00060.069320.0003
class_abstraction
Instantiating content class attribute0.00000.001250.0000
General
dbfile0.00060.0697160.0000
String conversion0.00000.001140.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
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
4content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/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: 12
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs