1

I have an HTML::Formhandler Form on my Catalyst Framework. The Problem is, that I get an error-message in the Form, when I load the Form-Site with an HTML GET-Requelst.

has_field 'name' => (type => 'Text', required => 1);

So if I load the Site via: localhost:3000/form no errors occurs. But if I load the Site via localhost:3000/form?foo=bar the form says: "Field required".

Any Idea how to solve this?

bor32
  • 41
  • 6

1 Answers1

1

By default HTML::FormHandler determines whether to validate a from by the existence of params. If you don't want to do that, you can use the 'posted' flag in the ->process statement. If you want the query parameter to provide a default to the form, you need to pass it in via an init_object: init_object => { foo => bar }.

gshank
  • 336
  • 1
  • 3