I've set up a paid-for event with online registration which uses a price set where a user can choose how many tickets they want in each of the available types and optionally add a donation (by entering multiples of £1).
It seems that a user can enter fractions and negative values in any field. And they can also not select anything but can continue.
I've done a temporary fix to test for fractions and negative values in a custom extension by adding some JavaScript in templates/CRM/Price/Form/Calculate.tpl and some extra validation code in CRM/Event/Form/Registration.php
Is there a better/recommended way of doing this? This would seem like a common requirement.
PS The CiviEvent Cart Checkout looks useful but is described as being in an Alpha state. Anyone using it successfully? https://wiki.civicrm.org/confluence/display/CRMDOC/CiviEvent+Cart+Checkout
Thanks in advance.