I have installed webform validation component along with standard clientside validation module.
In one of my webform, I have a single checkbox (for terms and condition agreement) which is set as required. Now when I visit the form and hit submit, the error msg that is shown for the checkbox is, "Minimum 1, maximum 99". It really made me crazy to find out where this weird msg is coming from!

Later, after a bit digging in the code, I found that for field of type 'checkboxes or checkbox' , js rule that is being added is 'checkboxgroupminmax'. You can find it in the function named '_clientside_validation_set_checkboxgroup_minmax' in clientside_validation.module page. Now the related js method has been defined in the file clientside_validation.js file as,

 jQuery.validator.addMethod("checkboxgroupminmax", function(value, element, param) {
      var amountChecked = $(param[2]).find('input:checked').length;
      return (amountChecked >= param[0] && amountChecked <= param[1]);
    }, jQuery.format('Minimum {0}, maximum {1}'));

So the error msg for js validaton is always shown in this weird format. When I changed this format for test purpose, it did replace the error msg in the form.
I am wondering how come this msg can be hardcoded in this format or if I am making any mistake in configuration?

Any quick help would be appreciated.

Comments

attiks’s picture

Did you try the dev version? If it does not work, can you provide a patch?