[html-formfu] ignoring DBIC column?

Carl Franks fireartist at gmail.com
Mon Oct 25 18:39:10 GMT 2010


On 25 October 2010 17:51, Yuval Kogman <nothingmuch at woobling.org> wrote:
> I've been at it for two hours but I can't figure out a way to ignore
> the value of a column for a certain object.
>
> Basically we have a form with a checkbox that corresponds to a column
> on a certain DBIC row.
>
> Under certain conditions even though the form checkbox is ticked, and
> the form is processed properly, the column still ends up being false.
>
> Under this scenario we still need to display the checkbox as ticked
> (i.e. what the user did).

Hi Yuval,

To stop $form->model->update() from using a field's value, set
    $element->model_config->{read_only} = 1;

To force it to use an alternative value, set
    $form->add_valid( $nested_name => $value );

I hope this helps - I wasn't able to follow exactly what's happening, and why.
If this is no use, can you try me again :)

Carl



More information about the HTML-FormFu mailing list