[html-formfu] constraint on multi-select elements

Thorsten Domsch tdomsch at gmx.de
Fri Jun 1 14:24:20 GMT 2007

Hi Carl, 

it's a petty but it doesn't work. I've tried something like this :

sub setup{


my $years = 
$self->form->element({ type => 'select', name => $self->name."_year", options => \@options } );

$years->constraints({ type=> 'Required', message=>'error1' });
$years->constraints({ type=> 'AllOrNone', message=>'error2', others=>[ $self->name.'_months', $self->name.'_days' ] });

   return $self;

what i get is a somewhat strange behaviour, the reqired constraint is fired always, except all three selectboxes are chosen, in this case the allornone  
constraint throwas an exception. So in the case above theres no possibility 
to successfully submit the form. 
Besides that being a very strange behaviour it in't even near what i want to do, namely $self->constraint({type = 'Required'... for example

But it looks like it's impossible to add a constraint to a multi field ?? but thats what i need to do...

Ist Ihr Browser Vista-kompatibel? Jetzt die neuesten 
Browser-Versionen downloaden: http://www.gmx.net/de/go/browser

More information about the HTML-FormFu mailing list