Still playing with the vertically-aligned example and trying out various features, including the validation constraints and error messages. But how to test the input error checking without lots of code or embedding into another program?

It is possible to feed sample input values into FormFu using the YAML config file. At the end of my FormFu .yml I added

query:
    contact_phone: testing
    contact_email: [EMAIL PROTECTED]

to set the form's 'input' values.

I had tried to use the "process:" key as documented, but because the config loading is still going on process() really can't, uh, process yet. So to force 'input' processing to test constraints and all, I simply added a process() call to the short demo program.
    my $form = HTML::FormFu->new;
    $form->load_config_file('uw1.yml');
    $form->process;

    my $tt = Template->new;
    $tt->process(
        'uw1.tt',
        { form => $form },
        'uw1.html',
    ) || die $tt->error;

I can feed bad values in, or leave some required values missing, and generally try out lots of combinations of errors, all without much coding. Just being lazy...
_______________________________________________
HTML-FormFu mailing list
HTML-FormFu@lists.scsys.co.uk
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/html-formfu

Reply via email to