- Posts: 967
- Thank you received: 220
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Change text of warning-message (mandatory questions)
- tammo
- Offline
- Official LimeSurvey Partner
Less
More
5 months 3 days ago #252564
by tammo
Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl
Replied by tammo on topic Change text of warning-message (mandatory questions)
Strange, previous reply was not accepted.
Here a new try:
Here a new try:
Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl
Please Log in to join the conversation.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13648
- Thank you received: 2491
5 months 3 days ago #252569
by DenisChenu
Do you want it for ALL surveys in instance ?
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.
Replied by DenisChenu on topic Change text of warning-message (mandatory questions)
Do you have access to the database directly ?can I somehow change the text that is shown to the user when a (soft-)mandatory question was not answered?
I do not have access to any folders/files concerning limesurvey (thus I cannot change the translation file), can the text be changed by using css or javascript?
Do you want it for ALL surveys in instance ?
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.
Please Log in to join the conversation.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10109
- Thank you received: 3595
5 months 3 days ago #252591
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Change text of warning-message (mandatory questions)
This will replace the modal pop-up text and the warning tip text, while preserving the warning tip icon.
Sample survey attached:
Code:
<script type="text/javascript" data-author="Tony Partner"> $(document).on('ready pjax:scriptcomplete',function(){ // Define some text strings var originalModalText = "Bij minstens een verplichte vraag ontbreekt het antwoord. Vul dit, indien mogelijk, in voordat je verder gaat op de volgende pagina."; var newModalText = "Why, why would you not answer this?"; var originalTipText="Let op, je hebt deze vraag nog niet beantwoord. Je kan verder gaan zonder de vraag te beantwoorden." var newTipText="Please answer this (non-mandatory) question... Come on..." // Modify the modal text var modalBody = $('.modal-body p').filter(function() { return $.trim($(this).text()) == originalModalText; }); if(modalBody.length > 0) { modalBody.text(newModalText); } // Identify the tip element(s) var oWarnings = $('.ls-question-mandatory').filter(function() { return $.trim($(this).text()) == originalTipText; }); if (oWarnings.length > 0) { // Clone the icon span var spanEl = $('span:eq(0)', oWarnings.first()).clone(); // Replace the tip text and icon span oWarnings.text(' '+newTipText).prepend(spanEl); } }); </script>
Sample survey attached:
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Please Log in to join the conversation.