Skip to content

Commit e3b1287

Browse files
committed
Merge pull request #6889 from Erftralle/client-validation-menu-type-single-news-feed
[imp]Client side validation for menu type single news feed
2 parents 8d86c05 + a59daf7 commit e3b1287

File tree

1 file changed

+18
-0
lines changed
  • administrator/components/com_newsfeeds/models/fields/modal

1 file changed

+18
-0
lines changed

administrator/components/com_newsfeeds/models/fields/modal/newsfeed.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,12 @@ protected function getInput()
6262

6363
$script[] = ' jQuery("#modalNewsfeed").modal("hide");';
6464

65+
if ($this->required)
66+
{
67+
$script[] = ' document.formvalidator.validate(document.getElementById("' . $this->id . '_id"));';
68+
$script[] = ' document.formvalidator.validate(document.getElementById("' . $this->id . '_name"));';
69+
}
70+
6571
$script[] = ' }';
6672

6773
// Clear button script
@@ -182,4 +188,16 @@ protected function getInput()
182188

183189
return implode("\n", $html);
184190
}
191+
192+
/**
193+
* Method to get the field label markup.
194+
*
195+
* @return string The field label markup.
196+
*
197+
* @since 3.4
198+
*/
199+
protected function getLabel()
200+
{
201+
return str_replace($this->id, $this->id . '_id', parent::getLabel());
202+
}
185203
}

0 commit comments

Comments
 (0)