[html-formfu] Best practice for multiple same forms

Bogdan Lucaciu bogdan at wiz.ro
Fri Nov 23 20:16:41 GMT 2007


On Friday 23 November 2007 17:01:22 Carl Franks wrote:
> If it's a single form with repeated similar parts, you could use the
> new Repeatable block element.

What do you think about adding some javascript support to that? Just show one 
div, and have a "+" button that creates yet another one and another one.

And for editing entities, you should have a 'remove' checkbox for the existing  
ones and an extra empty Repeatable block for adding, with the '+' button for 
adding new ones. 

This is a pattern that you see very often. The corresponding DBIC code could 
be just a few lines using Array::Diff on the ids.

What do you think? The javascript could be "optional", the + button could just 
make a post request that adds a new div if js is not wanted/supported in the 
browser

-- 
Bogdan Lucaciu
http://www.wiz.ro



More information about the HTML-FormFu mailing list