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

Brian Cassidy brian.cassidy at nald.ca
Mon Sep 24 14:54:50 GMT 2007


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>

-Brian



More information about the HTML-FormFu mailing list