% my $url = $opt{'post_url'} || popurl(1)."process/$table.html";
+% $js_form_validate = { 'edit_topform' => { 'name' => 'edit_topform' } };
<FORM NAME = "edit_topform"
METHOD = POST
ACTION = "<% $url %>"
% #any?
% 'colspan' => $f->{'colspan'},
% 'required' => $f->{'required'},
+%
+% #contact
+% 'custnum' => $f->{'custnum'},
+% 'prospectnum' => $f->{'prospectnum'},
% );
%
% $include_common{$_} = $f->{$_} foreach grep exists($f->{$_}),
% qw( js_only html_only select_only layers_only cell_style ),#selectlayers,?
% qw( empty_label ), # select-*
-% qw( value_col compare_sub order_by ), # select-table
+% qw( value_col compare_sub order_by addl_from ), # select-table
% qw( table name_col ), #(select,checkboxes)-table
% qw( target_table link_table ), #checkboxes-table
% qw( hashref agent_virt agent_null agent_null_right ),#*-table
% $include_common{'layer_prefix'} = "$field$fieldnum."
% if $layer_prefix_on;
%
+% ## set conditionname field values for validation.
+% if ($field eq 'conditionname') {
+% my $validate_field = $field . $fieldnum . '.after_event.run_delay';
+% $js_form_validate->{edit_topform}->{validate_fields}{$validate_field} = 'digits: true';
+% $js_form_validate->{edit_topform}->{error_message}{$validate_field} = 'Please only enter numbers here.';
+% }
+%
% my @include =
% ( "/elements/$include.html",
% 'field' => "$field$fieldnum",
: $opt{'html_foot'}
%>
- <% include("/elements/footer.html") %>
+% my %footerdata = (
+% 'formvalidation' => $js_form_validate,
+% );
+
+ <% include("/elements/footer.html", %footerdata) %>
% }
<%init>
my $fields = $opt{'fields'}
#|| [ grep { $_ ne $pkey } dbdef->table($table)->columns ];
|| [ grep { $_ ne $pkey } fields($table) ];
-#my @actualfields = map { ref($_) ? $_->{'field'} : $_ } @$fields;
+my @actualfields = map { ref($_) ? $_->{'field'} : $_ } @$fields;
+
+push @actualfields, $pkey;
+
+my $js_form_validate = {};
my( $mode, $object);
my $clone = '';
$mode = 'error';
$object = $class->new( {
- map { $_ => scalar($cgi->param($_)) } fields($table)
+ map { $_ => scalar($cgi->param($_)) } @actualfields
});
&{$opt{'error_callback'}}( $cgi, $object, $fields, \%opt )