[Html-widget] How to detect valid _and_ submitted?

Tobias Kremer t at funkreich.de
Fri Sep 8 11:30:03 CEST 2006


>   $c->forward( 'do_it' ) if !$c->widget_result( 'my_form' )->has_errors &&
>     $c->request->param( $w->indicator );

Of course, the following also works but still looks too verbose IMHO:

  if( !$c->widget_result( 'my_form' )->has_errors
    && $c->widget_result( 'my_form' )->is_valid ) {
    $c->forward( 'do_it' );
  }

Wouldn't it make sense to add this to HTML::Widget::Result as
something like a valid_and_submitted() method?

-- Tobias



More information about the Html-widget mailing list