Welcome, Guest
Username: Password: Remember me

TOPIC: javascript

javascript 2 years 11 months ago #59795

  • mattias
  • mattias's Avatar
  • OFFLINE
  • Senior Lime
  • Posts: 77
  • 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.

Re: javascript 2 years 11 months ago #59803

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 5838
  • Thank you received: 714
  • Karma: 222
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.
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.096 seconds
Donation Image