Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #389 from chdemko/25291

Joomla CMS [#25291] Front end clear link for media field and file field closes form
  • Loading branch information...
commit a3a99756df7c3a43b02c6b3e4d474c44ff811a3f 2 parents c6c28de + 33fda25
ianmacl ianmacl authored
Showing with 7 additions and 4 deletions.
  1. +7 −4 libraries/joomla/form/fields/media.php
11 libraries/joomla/form/fields/media.php
View
@@ -121,15 +121,18 @@ protected function getInput()
: 'index.php?option=com_media&view=images&tmpl=component&asset=' . $asset . '&author='
. $this->form->getValue($authorField)) . '&fieldid=' . $this->id . '&folder=' . $folder) . '"'
. ' rel="{handler: \'iframe\', size: {x: 800, y: 500}}">';
- $html[] = ' ' . JText::_('JLIB_FORM_BUTTON_SELECT') . '</a>';
+ $html[] = JText::_('JLIB_FORM_BUTTON_SELECT') . '</a>';
$html[] = ' </div>';
$html[] = '</div>';
$html[] = '<div class="button2-left">';
$html[] = ' <div class="blank">';
- $html[] = ' <a title="' . JText::_('JLIB_FORM_BUTTON_CLEAR') . '"' . ' href="#"' . ' onclick="document.getElementById(\'' . $this->id
- . '\').value=\'\'; document.getElementById(\'' . $this->id . '\').onchange();">';
- $html[] = ' ' . JText::_('JLIB_FORM_BUTTON_CLEAR') . '</a>';
+ $html[] = ' <a title="' . JText::_('JLIB_FORM_BUTTON_CLEAR') . '"' . ' href="#" onclick="';
+ $html[] = 'document.id(\'' . $this->id . '\').value=\'\';';
+ $html[] = 'document.id(\'' . $this->id . '\').fireEvent(\'change\');';
+ $html[] = 'return false;';
+ $html[] = '">';
+ $html[] = JText::_('JLIB_FORM_BUTTON_CLEAR') . '</a>';
$html[] = ' </div>';
$html[] = '</div>';
Please sign in to comment.
Something went wrong with that request. Please try again.