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.