Make the color of total field(s) of matrix table constant sum type black | XM Community
Solved

Make the color of total field(s) of matrix table constant sum type black

  • 12 April 2019
  • 6 replies
  • 60 views

Badge +1
Is there anyway to make the color of the numbers of the total field of a matrix table constant sum black instead of red?
icon

Best answer by Anonymous 14 April 2019, 05:04

View original

6 replies

Hello @HPowell ,

Paste the below code in the js(OnReady) of the question:

jQuery("#"+this.questionId+" .SumTotal input[type='text']").css("color","black");
Badge +1
Great. Thanks! I have one last part of this question...I have used JS to expand my input boxes on the same question, but the sum boxes do not line up. How do I get this corrected? My code is:

Qualtrics.SurveyEngine.addOnReady(function() {
jQuery(document).ready(function() {
var inputs = jQuery('[type=text]');
inputs.width("150px");
});
});
Badge +1
Actually, I tried adding your piece of code and it didn't work. My full code and the URL for testing is below:

Qualtrics.SurveyEngine.addOnReady(function() {

jQuery(document).ready(function() {

var inputs = jQuery('[type=text]');
inputs.width("150px");
jQuery("#"+this.questionId+" .SumTotal input[type='text']").css("color","black");

});
});

https://dimensional.co1.qualtrics.com/jfe/preview/SV_bpcJTINt5fqOfDD?Q_SurveyVersionID=current&Q_CHL=preview
Use the below code:

Qualtrics.SurveyEngine.addOnReady(function() {


var inputs = jQuery('[type=text]');
inputs.width("150px");
jQuery("#"+this.questionId+" .SumTotal input[type='text']").css("color","black");


});

Remove jQuery(document).ready(function() {)}; function wrap
Badge +1
Interesting...why would the jQuery(document).ready(function(){}); throw this off? I thought this function made it safer to execute jQuery. Also, the sum boxes do not align with the input boxes...any help here is greatly appreciated!
> @HPowell said:
> Interesting...why would the jQuery(document).ready(function(){}); throw this off? I thought this function made it safer to execute jQuery. Also, the sum boxes do not align with the input boxes...any help here is greatly appreciated!

Alignment problem may be because of some other CSS or JS you may have in question or at global level in header.

Leave a Reply