Skip to content

Commit 124c39d

Browse files
dgrammatikophproberto
authored andcommitted
[imp]Introduce jquery formvalidator for com_admin. Fixes #5039
1 parent e997083 commit 124c39d

File tree

1 file changed

+11
-11
lines changed
  • administrator/components/com_admin/views/profile/tmpl

1 file changed

+11
-11
lines changed

administrator/components/com_admin/views/profile/tmpl/edit.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,25 @@
1212
// Include the component HTML helpers.
1313
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
1414

15-
JHtml::_('behavior.formvalidation');
15+
JHtml::_('behavior.formvalidator');
1616

17+
JFactory::getDocument()->addScriptDeclaration('
18+
jQuery(document).ready(function() {
19+
Joomla.submitbutton = function(task)
20+
{
21+
if (task == "profile.cancel" || document.formvalidator.isValid(document.id("profile-form")))
22+
{
23+
Joomla.submitform(task, document.getElementById("profile-form"));
24+
}
25+
}
26+
});');
1727
// Load chosen.css
1828
JHtml::_('formbehavior.chosen', 'select');
1929

2030
// Get the form fieldsets.
2131
$fieldsets = $this->form->getFieldsets();
2232
?>
2333

24-
<script type="text/javascript">
25-
Joomla.submitbutton = function(task)
26-
{
27-
if (task == 'profile.cancel' || document.formvalidator.isValid(document.id('profile-form')))
28-
{
29-
Joomla.submitform(task, document.getElementById('profile-form'));
30-
}
31-
}
32-
</script>
33-
3434
<form action="<?php echo JRoute::_('index.php?option=com_admin&view=profile&layout=edit&id=' . $this->item->id); ?>" method="post" name="adminForm" id="profile-form" class="form-validate form-horizontal" enctype="multipart/form-data">
3535
<?php echo JHtml::_('bootstrap.startTabSet', 'myTab', array('active' => 'account')); ?>
3636

0 commit comments

Comments
 (0)