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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to