Adding a method and assigning it to all fields of a certain class(es)

Adding a method and assigning it to all fields of a certain class(es)

I got help with creating a method (to have only increments of 10 as valid values for certain fields in the form).

jQuery.validator.addMethod("roundnumber", function(value, element, params) {
return (value % 10) == 0;
 }, "Your order of vaccine must be in increments of 10");

I've also found info on how to add rules to a class (there are multiple fields and name generated dynamically so I have to use class).

 jQuery.validator.addClassRules("fluzone_", { roundnumber: true});

So I've added both these lines to additional-methods.js, but it does not validate it on submit. I do have php back-end logic that sets values to the nearest round number but I do want Js navigation before submission.
What am i doing wrong?