Am 15.08.2009 um 05:47 schrieb Steve Rippl:

Hi,

I have a Catalyst app with large dynamic forms, most of which gets built programatically with things like

...
my $element = $form->element( Text => $form_id );
$element->name($form_id);
$element->id($form_id);
...
$element->add_attributes( size => $size, maxlength => $size );
...
etc etc...

Now, how can I add constraints in this way? $element- >constraints( 'Range' => ( min => $min, max => $max )


$element->constraints( { type => 'Range', min => $min, max => $max } )
This should work.

There is also a Regex constraint:

$element->constraints( { type => 'Regex', regex => qr/regex/ } )

You need to create a custom Constraint if you want to have an "or" constraint.

cheers,

moritz

_______________________________________________
HTML-FormFu mailing list
HTML-FormFu@lists.scsys.co.uk
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/html-formfu

Reply via email to