Minimum and maximum values for numerical input - red notification text shows

More
2 years 11 months ago - 2 years 11 months ago #107884 by MarjaanaSianoja
Hello,

I'm trying to create a questionnaire with LimeSurvey but I'm having problems, when I set minimum and maximum values for (mandatory) "Numerical input" -questions.

First and most importantly, one of these questions works perfectly. With the other ones, immediately when entering the page and before inserting any answer, the questionnaire shows this "Each answer must be between 0 and 12" text in red and also the answering field is colored red. With all of these questions I chose "Hide tip -> yes". I already tried to open the questionnaire with a different browser (didn't help) and activated the survey and then answered it (didn't help either). I don't see any difference between constructing these questions (one of them doesn’t show this notification, the rest do), so I cannot figure out what went wrong.

Second, I would prefer this "Each answer must be between 0 and 12" text in Finnish, is there any way that I could enter it myself? I have set the language in Finnish and all the other texts in this questionnaire are automatically in Finnish and work perfectly.

I'm using LimeSurvey Version 2.00+ Build 121204.

If you know any solutions, I'm more than grateful, and please explain carefully, because this is so not my field of expertise.

Thank you very much!
Last Edit: 2 years 11 months ago by MarjaanaSianoja.

Please Log in to join the conversation.

More
2 years 11 months ago #107891 by tpartner
Can you attach a sample survey?

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.

More
2 years 11 months ago #107892 by MarjaanaSianoja
Thanks for answering! :)

Here's attached the questionnaire and then as an example question number 13, which is the first problematic one.

Let me know, if this wasn't what you were asking for :)
Attachments:

Please Log in to join the conversation.

More
2 years 11 months ago #107897 by tpartner
Hmm...seems to be a bug where if there is relevance assigned to the question the error text is initially shown.

To work around it, set up your survey to use JavaScript and add this to the source of all offending questions. If the numeric input is empty, the error text will be hidden.

<script type="text/javascript" charset="utf-8">	
	$(document).ready(function() {
 
		// Identify this question
		var thisQuestion = $('#question{QID}');
 
		if($('input[type="text"]', thisQuestion).val() == '') {
			$('.em_value_range, .numeric.em_sq_validation', thisQuestion).removeClass('error').addClass('good');
		}
	});
</script>

Regarding your second question, I don't see any English text. Perhaps you should update to the last stable version of 2.0 (131206).


Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Attachments:

Please Log in to join the conversation.