Stuck at the mall today, and just had to crack Rails Cookbook, by O'Reilly. It had a recipe for accepting dynamically created forms. The recipe resolved to build a grid on a page, and submit it with enumerable form post names.
The sample output looked like this (reconstructed):
Stuck at the mall today, and just had to crack Rails Cookbook, by
O'Reilly. It had a recipe for accepting dynamically created forms. The
recipe resolved to build a grid on a page, and submit it with enumerable
form post names.
The sample output looked like this (reconstructed):
Does anyone have the book to hand? The technical problem here is...
> naming a form field different from its ID is bad luck
Where do you get this from? There's nothing wrong with naming a form field
something other than it's ID, or not giving it an ID at all.
> an HTML ID should not start with a numeral (right?)
I'd have to check the HTML/XML spec, but that sounds right. Anyway, the
simplest solution is to use the name prefixed with something (e.g.
dynamic_) as the ID. Mind you, I suspect most browsers will happily deal
with whatever string you put in the ID field, numeric or not.
Can someone check if the book permits this bug in the IDs? Ruby form
helpers make it kind'a easy...