On 1 March 2010 18:56, Brian Cassidy <brian.cass...@gmail.com> wrote:
> On Mon, Mar 1, 2010 at 2:52 PM, Carl Franks <fireart...@gmail.com> wrote:
>>
>> I think you'll also need to set 'new_rows_max'.
>
> Adding "new_rows_max: 3" shows no change in the rendered form.

Ah, you didn't say at what stage the problem was ;)

If you're calling $form->model->default_values()
it should automatically expand the repeatable block.

If you're not, you'll need to do something like:

if ( ! $form->submitted ) {
    $form->get_all_element({ type => 'Repeatable' })->repeat(3);
    $form->get_all_element('count')->default(3);
    $form->process;
}

Your config should also define a hidden field - which in this example
is called 'count'
and set this on the Repeatable block
    counter_name: count

Carl

_______________________________________________
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