brainbuz / form-diva

Form::Diva Form Elements Generator
3 stars 2 forks source link

Suggestion: identify fields on output #7

Closed bbrtj closed 2 years ago

bbrtj commented 2 years ago

When experimenting with Form::Diva, I have a constant need to have info about which field on output is which. Since generated structure has only HTML data there isn't an easy way to check it. What I ended up doing is placing all my input on the comment attribute for a single field:

push @fields, {%field_data, comment => \%field_data};

That works, but:

I'd like to see something in the output hashref for a field that could enable me to identify the field. Field name at the very least, or maybe just a copy of the reference the way I did.

bbrtj commented 2 years ago

Probably better to stick with what we have. Comment field is not going to change, so its safe to pass whatever data needed in it.