Welcome Guest, Not a member yet? Register   Sign In
Validation sum of input
#4

One possible solution would be to add an extra field with the total sum. This may be a hidden field. Apply the callback rule to this field. The callback function adds up the numbers that were filled in in the 5 repartition[] fields. Return true if it's exactly 100, or false if it's smaller or greater than 100.
You could also fill the sum field dynamically with Javascript, or AJAX just before posting the form.
Reply


Messages In This Thread
Validation sum of input - by kenji - 06-03-2017, 08:20 AM
RE: Validation sum of input - by Avenirer - 06-04-2017, 07:50 AM
RE: Validation sum of input - by kenji - 06-04-2017, 07:58 AM
RE: Validation sum of input - by Wouter60 - 06-04-2017, 01:01 PM
RE: Validation sum of input - by lloricode - 06-04-2017, 08:34 PM
RE: Validation sum of input - by PaulD - 06-05-2017, 11:32 AM



Theme © iAndrew 2016 - Forum software by © MyBB