diff --git a/administrator/components/com_contact/models/fields/modal/contact.php b/administrator/components/com_contact/models/fields/modal/contact.php index cfe5dbbe03b46..83eeb161f0804 100644 --- a/administrator/components/com_contact/models/fields/modal/contact.php +++ b/administrator/components/com_contact/models/fields/modal/contact.php @@ -62,6 +62,12 @@ protected function getInput() $script[] = ' jQuery("#modalContact").modal("hide");'; + if ($this->required) + { + $script[] = ' document.formvalidator.validate(document.getElementById("' . $this->id . '_id"));'; + $script[] = ' document.formvalidator.validate(document.getElementById("' . $this->id . '_name"));'; + } + $script[] = ' }'; // Clear button script @@ -188,4 +194,16 @@ protected function getInput() return implode("\n", $html); } + + /** + * Method to get the field label markup. + * + * @return string The field label markup. + * + * @since 3.4 + */ + protected function getLabel() + { + return str_replace($this->id, $this->id . '_id', parent::getLabel()); + } }