I have a matrix table like this:
I'd like to apply Cleave code to all of the inputs, so I used the following code:
Qualtrics.SurveyEngine.addOnReady(function() {
var inputs = jQuery("input[type='text']");
inputs .toArray() .forEach(function(field)
{
new Cleave(field,
{
numeral: true,
numeralThousandsGroupStyle: 'thousand'});
Qualtrics.SurveyEngine.addOnPageSubmit(function()
{
cleave.element.value = cleave.getRawValue();
});
});
});
The above code works well. I can see my numbers have thousand commas.
Now I want to do some math works using the inputs in the next page. But the problem is that in the next page, it looks like the inputs are transformed into string. What I want to do is:
SUM column 1 = $e{ q://QID1/ChoiceTextEntryValue/1/1 + q://QID1/ChoiceTextEntryValue/2/1 + q://QID1/ChoiceTextEntryValue/3/1 }
I tried to use the code
cleave.element.value = cleave.getRawValue();, but this only works for one text entry, not for matrix table.
Please help me!