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

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

  • April 12, 2019
  • 6 replies
  • 118 views

Forum|alt.badge.img+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?

Best answer by Anonymous

> @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.

6 replies

  • April 12, 2019
Hello @HPowell , Paste the below code in the js(OnReady) of the question: jQuery("#"+this.questionId+" .SumTotal input[type='text']").css("color","black");

Forum|alt.badge.img+1
  • Author
  • April 12, 2019
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"); }); });

Forum|alt.badge.img+1
  • Author
  • April 12, 2019
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

  • April 12, 2019
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

Forum|alt.badge.img+1
  • Author
  • April 12, 2019
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!

  • Answer
  • April 14, 2019
> @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.