perl-embperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dimka <di...@dimka.ee>
Subject Embperl::Form::Validate question
Date Mon, 03 Mar 2003 15:19:48 GMT
Hi,

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?

### script start ###
[-
use Embperl::Form::Validate ;
$validate = Embperl::Form::Validate->new();
$validate->add_rule([-key=>'user', -msg=>'Missing', required=>1]);
if ( $fdat{do} ) { $errors = $validate->validate_messages() ; }
-]
[$if @$errors $]
    [$foreach $e (@$errors)$]
       <font color="red">[+ $e +]</font><br>
    [$endforeach$]
[$endif$]
<form method="post">
[## can't figure out how ##]
[$ if ($errors{user} == 1) $]<font color="red">User:</font>[$ else $]User:[$ endif
$] <input type="text" name="user"><br>
<input type="submit" name="do" value="Do">
</form>
### script end ###

tia,


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


Mime
View raw message