perl-embperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gerald Richter" <rich...@ecos.de>
Subject Re: Embperl::Form::Validate question
Date Sat, 15 Mar 2003 08:51:35 GMT
>
> How can i in embperl 2.0b8 with Validate module check, if some rule
> key ('user' in my example) is giving an error or not?
>

You need to use validate instead of messages:

use Embperl::Form::Validate ;
$validate = Embperl::Form::Validate->new();
$validate->add_rule([-key=>'user', -msg=>'Missing', required=>1]);

$result = $validate -> validate({user2 => 1}) ;
%errors = map { $_->{key} => 1} @$result ;


Gerald

--------------------------------------------------------------
Gerald Richter     ecos electronic communication services gmbh
IT-Securitylösungen * dynamische Webapplikationen * Consulting

Post:       Tulpenstrasse 5          D-55276 Dienheim b. Mainz
E-Mail:     richter@ecos.de          Voice:   +49 6133 939-122
WWW:        http://www.ecos.de/      Fax:     +49 6133 939-333
--------------------------------------------------------------
|
|   Besuchen Sie uns auf der CeBIT vom 12. - 19. März 2003
|   Messe Hannover * Halle 17 * Stand F 36
|   http://www.cebit.de/
|
+-------------------------------------------------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Mime
View raw message