Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • Awesome! I've always thought it a kludge that we have to use templates to mark invalid fields when we have the niceness of HTML::FillInForm doing the filling for us. Is this generic enough to do any kind of class setting for fields?
    • Thinking about my comment a little more, perhaps I should clarify. Instead of having the ability to specifically mark fields as invalid, why not be able to mark any fields a certain way. Something like:


      HTML::FillInForm->fill(\$html, $q,
          classify => {
              invalid => [qw(name password)],
              required => [qw(name password birth_date)],
          },
      );


      These are just the first 2 obvious uses I see for this, but I'm sure there are other
      • Sounds potentially useful, although I can't say I have an immediate need for it. I think it would be a pretty easy change to make.

        -sam

      • I think I'll like this patch as well.

        However, I think the form should be clearly marking which fields are required even before it is reloaded.

        So, a simple "invalid" class perhaps should be enough.

        I know ValidateRM usually puts "missing" or "invalid" on the page, but I had one customer who wanted to just use "Oops!" in all cases. I think that works in most cases, since the page design should already provide the context to explain /why/.

        In a few cases it is imported to provide more detail, like explaining tha
        • However, I think the form should be clearly marking which fields are required even before it is reloaded.

          You're assuming that I don't already run the form through HTML::FillInForm the first time. It's not just good for showing a form to a user for correcting, but for prefilling a form with either default values or something else (in the case of an edit screen).

          You're also assuming that the fields on a form are predefined. We have a CMS that let's users add extra custom fields to different form types and to decide which of those custom fields is required. Having the ability to do this when the form passes thro