%%.
5
==== MC Custom Validation ====
If there is a maximum point allocation or price, add custom validation to the multiple choice question to pass validation if the hidden text entry question is less than or equal to the maximum.
==== MC Question JavaScript ====
Add JS to call the mcPointAllocation function to apply it to the multiple choice question as follows:
Qualtrics.SurveyEngine.addOnload(function() {
mcPointAllocation(this);
});
To override the default options, specify the desired **[[mcsubchoices#options|options]]** is the second function argument as an object. For example:
Qualtrics.SurveyEngine.addOnload(function() {
mcPointAllocation(this,{max:1000,prefix:"$"});
});
==== Text Entry Question ====
A single line text entry question with any question text. No requirements, validation or JavaScript is needed.
===== Options =====
==== base ====
**base** is a numeric field containing a starting total before any choices are selected.
Default: 0
==== debug ====
**debug** is a boolean that turns on display of the hidden total question when true.
Default: false
==== decimals ====
**decimals** is numeric field specifying the number of decimal places the total should have.
Default: 0
==== label ====
**label** is a string that specifies the text label of the total.
Default: %%"Total: "%%
==== labelStyle ====
**labelStyle** is a string that specifies CSS style of the %%%% that contains the total label and total.
Default: %%"text-align:right;font-weight:bold;"%%
==== max ====
**max** is a numeric field containing the maximum total. When max=0 there is no maximum. When the total exceeds max, the total (including **[[mcpointallocation#prefix|prefix]]** and **[[mcpointallocation#prefix|suffix]]**) will be displayed in **[[mcpointallocation#overmaxcolor|overMaxColor]]**.
Default: 0
==== overMaxColor ====
**overMaxColor** is a string that specifies the CSS color to be used for the total when the max is exceeded.
Default: %%"red"%%
==== prefix ====
**prefix** is a string that specifies the text to be shown after the label and before the total (e.g., $).
Default: %%""%%
==== suffix ====
**suffix** is a string that specifies the text to be shown after the total (e.g., %%"€"%%).
Default: %%""%%
====== Qualtrics Wiki ======
[[start|Qualtrics Wiki]]