Hey
Stumbled upon something strange today.
My pattern (pseudo) for most formfu things is this:
sub create : bla FormEtc{
my $obj : Stashed = $c->model->new({ parent => $c->req-
>param('parent') });
$c->forward('doit');
}
sub edit : blah FormEtc {
my $obj : Stashed = $c->model->find($id);
$c->forward('doit');
}
sub doit : blah {
if ($form->submitted_and_valid) {
$form->model()->update($obj);
}
}
now the problem is that for create where parent is set, results in
submitted_and_valid triggering, can I prevent that somehow? if I set
constraints on the form elements, they stop it, but this results in
red boxes, which isn't really true, since its just showing the form
for the first time.
Or should I manually check for $c->req->method eq 'POST'?
- andreas
_______________________________________________
HTML-FormFu mailing list
HTML-FormFu@lists.scsys.co.uk
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/html-formfu