The orderFormMatrix function enables the creation of an order form with quantities, prices, and totals using a text entry matrix question.
Functionality and features include:
Here is an example:
This function is available for a reasonable fee. Contact TomG on the Qualtrics Community to learn more.
Add the orderFormMatrix function to the survey header to make it available to any question in the survey. Go to Look & Feel → General → Header edit →
and paste the provided orderFormMatrix function JS:
<script>/*Paste orderFormMatrix function JS here*/</script>
Alternatively, paste the orderFormMatrix function JS into a question's JS outside the existing Qualtrics functions to make it available to questions on the page.
Add JS to call the orderFormMatrix function to apply it to the text entry matrix question as follows:
Qualtrics.SurveyEngine.addOnload(function() {
orderFormMatrix(this);
});
To override the default options, specify the desired options in the second function argument as an object. For example:
Qualtrics.SurveyEngine.addOnload(function() {
orderFormMatrix(this,{qtyDecimals:1});
});
The orderFormMatrix function adds the class “ofm” to the question to enable custom CSS formatting of orderFormMatrix questions. This can be used to make totals bold, add currency symbols before or after prices, set the width of inputs, hide the price column (if prices are included in the item labels), etc.. Example CSS rules are provided with the orderFormMatrix function.
qtyDecimals specifies the number of decimals allowed in quantity fields.
Default: 0
totalDecimals the number of decimal places that should be displayed in the price subtotals and total. Amounts are rounded if necessary.
Default: 2