Nathan Wiger | 15 Mar 19:23
Picon

FormBuilder 3.02 for CPAN

Attached is version 3.02 of FormBuilder that I intend to
put on CPAN.

Please take a look as it's the last release I intend to do
for a few months. In particular, read the Changes file for
a ton of new features.

Thanks,
Nate
www.formbuilder.org

Peter Eichman | 15 Mar 21:02
Picon
Picon

problem with JS validation/requirement (Re: FormBuilder 3.02 for CPAN)

Something I just noticed with this version is that validated but not 
required fields are erroniously triggering the Javascript validation 
routines, and popping up an "invalid fields" alert.

Here is a minimal script that demonstrates this problem:

#!/usr/bin/perl -w
use strict;

# pops up an "alert" dialog even if
# the email field is blank

use CGI;
use CGI::Carp qw(fatalsToBrowser);
use CGI::FormBuilder;

my $q = CGI->new;
my $form = CGI::FormBuilder->new(
     fields => [qw(email)],
     params => $q,
);
$form->field(name => 'email', required => 0, validate => 'EMAIL');

unless ($form->submitted && $form->validate) {
     print $q->header;
     print $form->render;
} else {
     print $q->header('text/plain');
     print "Success!"
}
(Continue reading)

Nathan Wiger | 16 Mar 00:00
Picon

Re: problem with JS validation/requirement (Re: FormBuilder 3.02 for CPAN)

 > Something I just noticed with this version is that validated but not
 > required fields are erroniously triggering the Javascript validation
 > routines, and popping up an "invalid fields" alert.

Thanks Peter, I'll check that out. At first glance it appears to be 
per-browser (some like the new JS code and others don't).

Anybody on the list a JavaScript expert??

> Related to this, I've also been wondering if it would be possible to 
> separate the enabling of javascript (client-side) validation from the 
> other javascript used to drive things like 'other' or 'growable' fields? 
> This is not urgent, and is something I could easily look into creating a 
> patch for; I thought I'd just float the idea to the list and see what 
> other people felt about it.

Sounds reasonable to me.

-Nate

Nathan Wiger | 15 Mar 19:24
Picon

Re: FormBuilder 3.02 for CPAN

The file might help...

Nathan Wiger wrote:
> Attached is version 3.02 of FormBuilder that I intend to
> put on CPAN.
> 
> Please take a look as it's the last release I intend to do
> for a few months. In particular, read the Changes file for
> a ton of new features.
> 
> Thanks,
> Nate
> www.formbuilder.org

Attachment (CGI-FormBuilder-3.02.tar.gz): application/x-gunzip, 104 KiB

Gmane