Check out the LimeSurvey source code on GitHub!

Multiple Question Validation problem

More
5 years 10 months ago - 5 years 10 months ago #57659 by AndrejL
Hi!

I have a simple list radio question with other option included.

I would like to add validation for other filed which is btw numerical only.

With help from workarounds page I wrote this code in the question following the question I want to validate.
<script type="text/javascript" charset="utf-8">
 
if ("{INSERTANS:sidXgidXqidother}" > 100) {
 
alert("Number must be less than 100!");
document.limesurvey.move.value = "moveprev";
document.limesurvey.submit();
}
 
</script>

If condition is met the alert is displayed but it doesn't move back one question.

Survey is set to to "Q by Q", and back button is enabled. Filter for XSS is off.

Thanks,

Andrej
Last Edit: 5 years 10 months ago by AndrejL.

Please Log in to join the conversation.

More
5 years 10 months ago #57660 by AndrejL
Sorry I accidentally posted this in 'Installation & update issues section' :blush:

Admin, could you move it to 'Can I do this with LimeSurvey', please.

Thank you

Please Log in to join the conversation.

Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form