[html-formfu] Modifying a form field.

Leanan Sidhe the.leanan.sidhe at gmail.com
Thu Apr 2 15:09:27 BST 2009


add_valid() should work, but takes 2 args - ( $name, $value )
>
> [snip]
>
> _______________________________________________
> HTML-FormFu mailing list
> HTML-FormFu at lists.scsys.co.uk
> http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/html-formfu
>

Hrm.  Then that means my order of things is off.  I was doing this in my
controller:

if ($form->submitted) {
  $converted_form =3D do_conversion($form);
  $converted_form->process;
  if ($converted_form->valid) {
    $converted_form->model->update($c->model('DB::Foo'));
  }
}

Also, on the transformers: Are those run both ways (IE, when loading and
processing the form) or only one way (when processing the form) ?  I've
considered using inflators and deflators, even though technically I'm not
deflating/inflating objects in this case.  The only problem with that
(beyond the non-intended usage) is that the conversion I do is dependent
upon another field in the form's value and I saw no way to say in the
inflator "when field y is x, do a, else do b".
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/html-formfu/attachments/20090402/a0=
cd10ea/attachment.htm


More information about the HTML-FormFu mailing list