% my $url = $opt{'post_url'} || popurl(1)."process/$table.html";
-% $js_form_validate = { 'edit_topform' => { 'name' => 'edit_topform', 'errormessage' => 'Please only numeric characters ' } };
+% $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->{$_}),
% ## 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_field} = 'numeric';
+% $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 =
var newrow = <% include(@layer_opt, html_only=>1) |js_string %>;
% #until the rest have html/js_only
-% if ( $type eq 'selectlayers' || $type =~ /^select-cgp_rule_/ ) {
+% if ( $type eq 'selectlayers' || $type =~ /^select-cgp_rule_/ || $type eq 'contact') {
var newfunc = <% include(@layer_opt, js_only=>1) |js_string %>;
% } else {
var newfunc = '';
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 = {};
$mode = 'error';
$object = $class->new( {
- map { $_ => scalar($cgi->param($_)) } fields($table)
+ map { $_ => scalar($cgi->param($_)) } @actualfields
});
&{$opt{'error_callback'}}( $cgi, $object, $fields, \%opt )