Re: [Cppcms-users] Feature-Request be able to to set an error code/message to know why a form faile
Brought to you by:
artyom-beilis
|
From: <un...@fu...> - 2013-03-11 18:13:08
|
hi,
(if I understand your question correctly)
you can iterate through form and do something like this
virtual bool validate_2m( data::flash_messages &m ) {
if( !cppcms::form::validate() ) {
for( cppcms::form::iterator it = begin(); it != end(); ++it )
if( ! it->valid() )
m.add_e( it->error_message() );
return false;
}
return true;
}
On Mon, 11 Mar 2013 16:45:11 +0000, SIMON Allan wrote:
> Hello
>
> It would be nice to be able to have some way to know during the
> validation of a form, the reason why it fails (while still using the
> function 'validate') i.e being able to stack the error message or
> error code and being able to get them after.
>
> Regards,
>
> Allan SIMON
> Tatoeba Administrator (Sysko)
|