projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
RT# 21110 Unparsable age error. Added javascript to validate field prior to submittin...
[freeside.git]
/
httemplate
/
edit
/
elements
/
edit.html
diff --git
a/httemplate/edit/elements/edit.html
b/httemplate/edit/elements/edit.html
index
8dd15dc
..
3eb75f8
100644
(file)
--- a/
httemplate/edit/elements/edit.html
+++ b/
httemplate/edit/elements/edit.html
@@
-240,6
+240,7
@@
Example:
% my $url = $opt{'post_url'} || popurl(1)."process/$table.html";
% my $url = $opt{'post_url'} || popurl(1)."process/$table.html";
+% $js_form_validate = { 'edit_topform' => { 'name' => 'edit_topform', 'errormessage' => 'Please only numeric characters ' } };
<FORM NAME = "edit_topform"
METHOD = POST
ACTION = "<% $url %>"
<FORM NAME = "edit_topform"
METHOD = POST
ACTION = "<% $url %>"
@@
-247,7
+248,7
@@
Example:
>
<INPUT TYPE="hidden" NAME="svcdb" VALUE="<% $table %>">
>
<INPUT TYPE="hidden" NAME="svcdb" VALUE="<% $table %>">
- <INPUT TYPE="hidden" NAME="<% $pkey %>" VALUE="<% $clone ? '' : $object->$pkey() %>">
+ <INPUT TYPE="hidden"
ID="<% $pkey %>"
NAME="<% $pkey %>" VALUE="<% $clone ? '' : $object->$pkey() %>">
<% defined($opt{'form_init'})
? ( ref($opt{'form_init'})
<% defined($opt{'form_init'})
? ( ref($opt{'form_init'})
@@
-372,6
+373,7
@@
Example:
% qw( alt_format ), #select-cust_location
% qw( classnum ), # select-inventory_item
% qw( aligned ), # columnstart
% qw( alt_format ), #select-cust_location
% qw( classnum ), # select-inventory_item
% qw( aligned ), # columnstart
+% qw( debug ), # select-table
% ;
%
% #select-table
% ;
%
% #select-table
@@
-407,6
+409,12
@@
Example:
% $include_common{'layer_prefix'} = "$field$fieldnum."
% if $layer_prefix_on;
%
% $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_field} = 'numeric';
+% }
+%
% my @include =
% ( "/elements/$include.html",
% 'field' => "$field$fieldnum",
% my @include =
% ( "/elements/$include.html",
% 'field' => "$field$fieldnum",
@@
-833,7
+841,11
@@
Example:
: $opt{'html_foot'}
%>
: $opt{'html_foot'}
%>
- <% include("/elements/footer.html") %>
+% my %footerdata = (
+% 'formvalidation' => $js_form_validate,
+% );
+
+ <% include("/elements/footer.html", %footerdata) %>
% }
<%init>
% }
<%init>
@@
-851,6
+863,8
@@
my $fields = $opt{'fields'}
|| [ grep { $_ ne $pkey } fields($table) ];
#my @actualfields = map { ref($_) ? $_->{'field'} : $_ } @$fields;
|| [ grep { $_ ne $pkey } fields($table) ];
#my @actualfields = map { ref($_) ? $_->{'field'} : $_ } @$fields;
+my $js_form_validate = {};
+
my( $mode, $object);
my $clone = '';
if ( $opt{'embed'} ) {
my( $mode, $object);
my $clone = '';
if ( $opt{'embed'} ) {