diff --git a/main/inc/lib/formvalidator/FormValidator.class.php b/main/inc/lib/formvalidator/FormValidator.class.php
index 780dc64f2d..91680ff085 100644
--- a/main/inc/lib/formvalidator/FormValidator.class.php
+++ b/main/inc/lib/formvalidator/FormValidator.class.php
@@ -276,7 +276,10 @@ EOT;
$this->addElement('html','');
$this->addElement('html','');
-
+ if(!$waitAfterUpload)
+ {
+ $waitAfterUpload = 0;
+ }
// add the upload event
$this->updateAttributes("onsubmit=\"myUpload.startRealUpload('dynamic_div','".$upload_id."','".$this->getAttribute('id')."',".$waitAfterUpload.")\"");