Formatting answer fields with comma separator and auto-sum

fabioruffinonifabioruffinoni ItalyCommunity Member Qubie ✭

Formatting answer fields with comma separator and auto-sum

We are encountering some issues in validating the formatting we have set for our fields. In fact, we have managed to put the formatting ( the ',' as the thousands separator) however there is an alert that appears stating "Exclude commas and, if necessary, use a full-stop as a decimal separator" and does not accept the input.

Consequently we do not manage to submit the results and carry forward in the email. Is it possible to eliminate this alert and remove it?


  • TomGTomG Raleigh, NCCommunity Member, Product Ideas Wizard ✭✭✭✭✭


    Where are you seeing this error? In a survey question? When you add commas to a number, it becomes a string and is no longer treated as a number. That is probably the root cause of your issue.


  • fabioruffinonifabioruffinoni ItalyCommunity Member Qubie ✭


    Yes, we are seeing this issue associated to a survey question, in particular with matrix questions with the constant sum feature.
    We have saw the discussion and followed it and what we want to achieve is exactly the same as the example provided ( but we seem not to manage.

    Below is the code we inserted with the components associated to the formatting of it and here is the link to the survey, when inserting a number is an editable field, it does not allow you to then proceed with the survey:

    Do you see the mistake or know what the issue could be?


    Custom code

    var inputs = jQuery("input[type='text']"); inputs.attr('maxlength','11'); inputs .toArray() .forEach(function(field) { new Cleave(field, { numeral: true, numeralThousandsGroupStyle: 'thousand', }); });
  • TomGTomG Raleigh, NCCommunity Member, Product Ideas Wizard ✭✭✭✭✭


    As I mentioned in my earlier post, once you add commas to a numeric field, it becomes a string instead of a number. At that point you can't do any numeric validation on it. When you format numbers with cleave you are changing them to strings.

    In the example I posted, I hid the original constant sum fields and replaced them with new inputs that cleave is attached to. JS then keeps the new inputs the original hidden inputs in sync.

Sign In to Comment