Check out the LimeSurvey source code on GitHub!

javascript

More
5 years 9 months ago #59795 by mattias01
Friends

and tried to make a validation if a field is greater than another throw an alert using javascript but it throws an error Can you help me this is my function


validation function ()
{
if ("{INSERTANS: 98382X261X4872}" <= "{INSERTANS: 98382X261X4873} ")
{
alert ("The total number of boxes must be greater than or equal to the number of active cases");
document.limesurvey.move.value = 'MovePrev';
document.limesurvey.submit ();
}
else
{
document.limesurvey.move.value = 'MoveLast';
document.limesurvey.submit ();
}
}

setTimeout ("validation ()", 250);

I hope you can help me greetings

thanks

Please Log in to join the conversation.

More
5 years 9 months ago #59803 by DenisChenu
Hello,

You can use {INSERTANS: 98382X261X4872} in a javascript only on a group (for a group by group survey) after the question.

For the same page, you have to use $('#questionXXX input').val(); jquery function.

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).

Please Log in to join the conversation.

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