Multiple submits and chrome

41 views
Skip to first unread message

romdav

unread,
Apr 2, 2011, 9:39:12 PM4/2/11
to perl-formbuilder
Hi all,

I have a issue whit the google chrome web browser and multiple
submits.

See on http://www.formbuilder.org/tutor/index.pl?c=2&s=8 the
Javascript code in the "jsfunc" option is not working on chrome.

I have created a patch for this issue, I hope you may integrate it in
the CPAN version.


--- trunk/lib/CGI/FormBuilder.pm 2011-04-02 18:24:51.432354538 -0700
+++ tags/3.0502/lib/CGI/FormBuilder.pm 2011-04-02 18:29:09.294354709
-0700
@@ -18,8 +18,8 @@
use CGI::FormBuilder::Field;
use CGI::FormBuilder::Messages;

-our $VERSION = '3.0501';
-our $REVISION = do { (my $r='$Revision: 100 $') =~ s/\D+//g; $r };
+our $VERSION = '3.0502';
+our $REVISION = do { (my $r='$Revision: 101 $') =~ s/\D+//g; $r };
our $AUTOLOAD;

# Default options for FormBuilder
@@ -820,6 +820,11 @@
type => 'hidden', value => $self-
>{page});
}

+ # submit button statetag for multiple submits
+ if (ref $self->{submit} eq 'ARRAY') {
+ push @html, htmltag('input', name=>$self->{submitname},
type=>'hidden', value=>$self->{submit}[0]);
+ }
+
return wantarray ? @html : join "\n", @html;
}

@@ -1087,7 +1092,7 @@
push @submit, { type => 'submit',
id => "$self->{name}$sn$si",
class => $sc,
- name => $sn,
+ name => "$sn$i",
value => $subval, @oncl };
$i++;
}
Reply all
Reply to author
Forward
0 new messages