hidden fields & reset

12 views
Skip to first unread message

Adam Prime

unread,
Feb 15, 2014, 9:47:04 PM2/15/14
to rose-htm...@googlegroups.com
I just ran into something that's probably not a bug, but certainly
confused me. I think a small change to the documentation might make this
far less likely to happen to other people.

The docs suggest creating hidden fields like this:

$field =
Rose::HTML::Form::Field::Hidden->new(
name => 'code',
value => '1234');

However, if you have a form that has that hidden field in it, and you
call reset on the form, then the value is removed and replaced with the
default which is, in this case, undef.

Most of the time, i think this probably isn't what people would expect
to happen. Or maybe that's just wishful thinking on my part because i
didn't expect it, but at any rate, i think if the documentation said:

$field =
Rose::HTML::Form::Field::Hidden->new(
name => 'code',
default => '1234');

in the synopsis, then it might keep other people from running into the
same issue.

Thoughts?

Adam
Reply all
Reply to author
Forward
0 new messages