6

While filling the questionnaire a JavaScript alert occurs when a mandatory question or validation error found. After alert a read message displayed which looks good but alert annoys. Is there any way to disable alert throughout the Survey?

In Lime survey it is different to place code for java script.

3 Answers3

1

Try this:

var newAlert = alert; // Preserving alert.

// Overriding the default alert.
alert = function(str){
    return;
}
void
  • 36,090
  • 8
  • 62
  • 107
  • Yes.It works fine. Thanks void. Hope it will work for all browsers. – Hafiz Fahad Munir Dec 17 '15 at 07:56
  • @PHPBeginner how could this work while the identical code from the other answer did not? – zerkms Dec 17 '15 at 08:00
  • @void voting up requires 15 reputations but i have 11 currently. Will up vote when equal to 15 – Hafiz Fahad Munir Dec 17 '15 at 08:02
  • @zerkms you need to pass the argument, `alert` takes an string argument. – void Dec 17 '15 at 08:03
  • @void you don't. Your code is identical to the `alert = function(){};` (which is suggested in the other answer) as per the standard. There is no way these 2 functions to behave differently. You don't use the `str` variable so it might be omitted. The same for `return`. – zerkms Dec 17 '15 at 08:03
0

try this once . IT will disable all alerts. alert = function() {};

Shubham
  • 1,755
  • 3
  • 17
  • 33
0

Update application/config/config.php :

    'config'=>array(
        'debug'=>0,
        'showpopups'=>0,
    )

https://manual.limesurvey.org/Optional_settings#Survey_Behavior

Denis Chenu
  • 846
  • 2
  • 7
  • 22