diff options
author | root <root@debian8-7-1> | 2017-02-17 09:37:06 -0500 |
---|---|---|
committer | root <root@debian8-7-1> | 2017-02-17 09:37:06 -0500 |
commit | bf951595745feebeebc8acf91a5cf846c22c6533 (patch) | |
tree | edfd9dbf0dd1d61d9c0f2ddcfd5d9bbc474f84f5 /httemplate/edit/elements/edit.html | |
parent | c69e68e25b519c7f9d2ad47cb0ae6fc90c0f016c (diff) |
RT# 21110 Unparsable age error. Added javascript to validate field prior to submitting the form. Also place checked prior entry in database.
Diffstat (limited to 'httemplate/edit/elements/edit.html')
-rw-r--r-- | httemplate/edit/elements/edit.html | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/httemplate/edit/elements/edit.html b/httemplate/edit/elements/edit.html index a0023382e..3eb75f85f 100644 --- 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"; +% $js_form_validate = { 'edit_topform' => { 'name' => 'edit_topform', 'errormessage' => 'Please only numeric characters ' } }; <FORM NAME = "edit_topform" METHOD = POST ACTION = "<% $url %>" @@ -408,6 +409,12 @@ Example: % $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", @@ -834,7 +841,11 @@ Example: : $opt{'html_foot'} %> - <% include("/elements/footer.html") %> +% my %footerdata = ( +% 'formvalidation' => $js_form_validate, +% ); + + <% include("/elements/footer.html", %footerdata) %> % } <%init> @@ -852,6 +863,8 @@ my $fields = $opt{'fields'} || [ grep { $_ ne $pkey } fields($table) ]; #my @actualfields = map { ref($_) ? $_->{'field'} : $_ } @$fields; +my $js_form_validate = {}; + my( $mode, $object); my $clone = ''; if ( $opt{'embed'} ) { |