Check out the LimeSurvey source code on GitHub!
Welcome, Guest
Username: Password:

TOPIC: javascript

javascript 5 years 3 months ago #59795

  • mattias
  • mattias's Avatar
  • Offline
  • Senior Lime
  • Posts: 79
  • Karma: 1
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
The administrator has disabled public write access.

javascript 5 years 3 months ago #59803

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • Moderator Lime
  • Posts: 9293
  • Thank you received: 1327
  • Karma: 384
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 developpement are on my free time (Say thanks ?).
A bug not reported is a bug not corrected. | Please, read the documentation | La doc en français à besoin de vous
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.204 seconds
Imprint                   Data Protection Statement                  Revocation information and revocation form