http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15206

Frédéric Demians <frede...@tamil.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |frede...@tamil.fr

--- Comment #6 from Frédéric Demians <frede...@tamil.fr> ---
Code review:

You have:

    function CalculateAge(dateofbirth) {

Then, you don't use "dateofbirth".

You have:

  <input type="text" id="dateofbirth" name="dateofbirth" size="20"
   onchange="CalculateAge(document.form.dateofbirth);"
   value="[% UNLESS opduplicate %][% dateofbirth %][% END %]" />

You rather should use jQuery:

  $( "#dateofbirth" ).change(CalculateAge);

From an UI point of view, it seems awkward to have displayed firstly
"DD/MM/YYYY" under the Date of birth text box, and then having this info
replaced by the age. This way, it's not possible to see the age without
modifying the date of birth. Wouldn't it be better/simpler to display the age
on the detail page (moremember.pl), rather than on the editing page
(memberentry.pl)?

Have you seen that there is already a Perl function calculating age in Koha?
C4::Members::GetAge(). There is a risk that your javascript code and Perl
GetAge() produce a different age.

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to