[html-formfu] multiple ids of the same value in radiogroup

Carl Franks fireartist at gmail.com
Mon Sep 24 19:42:15 GMT 2007

On 24/09/2007, Brian Cassidy <brian.cassidy at nald.ca> wrote:
> Hey Gang,
> I was just playing around with the Radiogroup element, and i noticed the
> default rendering sets the same id for each option. Naturally this is
> invalid html. Traditionally i've done <input type="radio" name="$field"
> value="$value" id="${field}_${value}" /> <label
> for="${field}_${value}">...</label> because the value is usually a
> numeric id. This give you something like:
> <input type="radio" name="foo" value="1" id="foo_1" /> <label
> for="foo_1">...</label>

Are you using auto_id() ?
If you are, this should already be handled for you, by adding an
incremented integer to the end of the ID.
See lib/HTML/FormFu/Element/RadioGroup.pm - sub _prepare_id()


More information about the HTML-FormFu mailing list