Check out the LimeSurvey source code on GitHub!

Alert and button "moveprev" works on 2.00 but not working on 2.05

More
2 years 10 months ago #105879 by DWS
Hi,

I used to put alerts for some cases that mandatory doesn't fit ok for my needs. The code is
<script type="text/javascript" charset="utf-8">
var rp1="{INSERTANS:198784X2X4410}";
function validation()
{ if (rp1 > 12)    { alert("Alert....");
        document.limesurvey.move.value = 'moveprev';
        document.limesurvey.submit();     } }
setTimeout("validation()",250);
</script>

and works fine on 2.00 but not on 2.05. The alert goes on and on and on... and don't go back to previous page.

Any idea about is not working?

Thanks.
Regards.

Please Log in to join the conversation.

More
2 years 10 months ago #105921 by DenisChenu
Hi,

There an update of 'navigation' system in 2.05. This update alow to go previous i any condition (even with 'text browser').

Just use $("#moveprev").click(); I think it do the trick.

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).
The following user(s) said Thank You: DWS

Please Log in to join the conversation.

More
2 years 10 months ago #105984 by DWS
Hi Denis, thanks for your help


I'm sorry but $("#moveprev").click(); doesn't do the trick, it does the same as document.limesurvey.move.value = 'moveprev';

any suggestion?

Please Log in to join the conversation.

More
2 years 10 months ago #105996 by DenisChenu
Hi,
$("#moveprevbtn").click();
or
$("#defaultbtn").val('moveprev').click();
Tested OK

BUT : you need to accept "Allow prev" in survey settings (else it was set to default in Expression Manager (i think).

But one question : why don't use Existing included LimeSUrvey function (validation etc ...)

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.

More
2 years 10 months ago #105997 by DWS
Hi,

both methods works fine.

We apply in a multi-numeric question to validate the result of each of the sub-questions. So I can leave the question as non required but manage the values of each sub-question.

Also I do to learn more about programming and enlarge the possibilities of Limesurvey.

Thank for so much your help.

Please Log in to join the conversation.

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