Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Editing mandatory text

More
8 years 10 months ago #120250 by mih
Editing mandatory text was created by mih
Hi,

I've set up a survey with mandatory questions sets and was wondering if there was any way for me to change the automatically generated text from "This question is mandatory. Please complete all parts." to "Please answer all questions." without accessing the translation file (i.e. is this applicable to my situation, and if so, is it the only solution?)

Thanks.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 10 months ago #120268 by tpartner
Replied by tpartner on topic Editing mandatory text
Try adding this to the end of template.js:
Code:
$(document).ready(function() {  
 
  var originalText = 'This question is mandatory.  Please complete all parts.';
  var newText = 'Please answer all questions.';
 
  $('.errormandatory').filter(function() {
    return $.trim($(this).text()) == originalText;
  }).text(newText);
  $('.errormandatory').show();
});


And, then add something like this to the end of template.css to avoid flashing the original text:
Code:
.errormandatory {
  display: none;
}

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: mih
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 10 months ago #120285 by DenisChenu
Replied by DenisChenu on topic Editing mandatory text
Hi,

ANd if question have em_validation_q manual.limesurvey.org/Question_type_-_Mu..._validation_q_tip.29

Deactivate mandatory and put : count(self)==X (replace X by number of sub question)

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The following user(s) said Thank You: mih
The topic has been locked.
More
8 years 10 months ago #120369 by mih
Replied by mih on topic Editing mandatory text
Thank you for your help! It's my first time using this tool, and I really appreciate the quick tip.

On a somewhat unrelated note, the survey I am designing currently supports two different languages, each with a different title and subtitle (so I can't make the changes through the source code). I want to introduce two different styles to differentiate between the title and subtitle; however, when I try to make this change in the title section of the survey, it shows the HTML code in the tab title (i.e. <h1>Title</h1> <h2>Subtitle</h2> shows up on the title of the tab/window).

So I guess my question is:
1. How can we not show the HTML tags in the title of the tab/window?
2. Would we be able to have a different title for the survey itself and the title for the window/tab (keeping in mind we need a different title for both the English & French version)?

Thanks in advance.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 10 months ago #120371 by DenisChenu
Replied by DenisChenu on topic Editing mandatory text
Hi,

I startpage.pstpl : you can use Expression Manager.

gitlab.com/Sondages.Pro/SkeletonQuest/bl...r/startpage.pstpl#L3

strip_tags is made for you.

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The following user(s) said Thank You: mih
The topic has been locked.
More
8 years 9 months ago #120818 by mih
Replied by mih on topic Editing mandatory text
Thanks for the tip! The title is now displaying properly.

As I was going through the survey the other day, I ran into another problem that I was hoping someone could help me with. Specifically, I was trying to change the French translation of the mandatory message from "Cette question est obligatoire. Veuillez compléter toutes les parties." to simply "Veuillez compléter toutes les parties." I've tried directly accessing the .po files and removing the corresponding translation, but that just resulted in the following output: "Veuillez compléter toutes les parties..Please complete all parts." Is there any way I can address this problem? Please let me know if any part of the explanation was confusing and I'd be happy to clarify further.

Thanks in advance.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 9 months ago #120826 by DenisChenu
Replied by DenisChenu on topic Editing mandatory text
Hi, again : don't use mandatory , but
- Whole question validation equation
- Tip for whole question validation equation

manual.limesurvey.org/Question_type_-_Mu..._validation_q_tip.29

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose