Bug 17222: Remove use of onclick from OPAC member entry page
authorAleisha Amohia <aleishaamohia@hotmail.com>
Mon, 29 Aug 2016 23:22:11 +0000 (23:22 +0000)
committerKyle M Hall <kyle@bywatersolutions.com>
Fri, 9 Sep 2016 10:53:19 +0000 (10:53 +0000)
There is only one instance on onclick here, and that is the clear date
function.

To test, make sure clicking 'Clear date' next to Date of Birth works the
same before and after the patch.

Sponsored-by: Catalyst IT
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt

index e19d067..9605326 100644 (file)
 
                                             [% UNLESS action == 'edit' && !OPACPatronDetails %]
                                                 [% UNLESS ( mandatory.defined('dateofbirth') ) %]
-                                                    <a href="#" style="font-size:85%;text-decoration:none;" onclick="document.getElementById('borrower_dateofbirth').value='';return false;">Clear date</a>
+                                                    <a href="#" style="font-size:85%;text-decoration:none;" class="cleardate">Clear date</a>
                                                 [% END %]
                                             [% END %]
 
                 });
             [% END %]
         });
+
+    $(".cleardate").on("click", function(){
+        document.getElementById('borrower_dateofbirth').value='';
+        return false;
+    });
     //]]>
     </script>
 [% INCLUDE 'calendar.inc' %]