addScriptDeclaration(' Joomla.submitbutton = function(task) { if (task == "contact.cancel" || document.formvalidator.isValid(document.getElementById("contact-form"))) { ' . $this->form->getField("misc")->save() . ' Joomla.submitform(task, document.getElementById("contact-form")); } }; '); ?>