mirror of
https://github.com/joomla-extensions/weblinks.git
synced 2025-01-26 22:08:27 +00:00
Merge pull request #18 from dgt41/jquery_1
Introduce jquery formvalidator for com_weblinks
This commit is contained in:
commit
67d0850975
@ -11,19 +11,19 @@ defined('_JEXEC') or die;
|
||||
|
||||
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
|
||||
|
||||
JHtml::_('behavior.formvalidation');
|
||||
JHtml::_('behavior.formvalidator');
|
||||
JHtml::_('formbehavior.chosen', 'select');
|
||||
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
JFactory::getDocument()->addScriptDeclaration("
|
||||
Joomla.submitbutton = function(task)
|
||||
{
|
||||
if (task == 'weblink.cancel' || document.formvalidator.isValid(document.id('weblink-form'))) {
|
||||
<?php echo $this->form->getField('description')->save(); ?>
|
||||
if (task == 'weblink.cancel' || document.formvalidator.isValid(document.getElementById('weblink-form'))) {
|
||||
" . $this->form->getField('description')->save() . "
|
||||
Joomla.submitform(task, document.getElementById('weblink-form'));
|
||||
}
|
||||
}
|
||||
</script>
|
||||
};
|
||||
");
|
||||
?>
|
||||
|
||||
<form action="<?php echo JRoute::_('index.php?option=com_weblinks&layout=edit&id=' . (int) $this->item->id); ?>" method="post" name="adminForm" id="weblink-form" class="form-validate">
|
||||
|
||||
|
@ -27,24 +27,25 @@ if ($saveOrder)
|
||||
JHtml::_('sortablelist.sortable', 'weblinkList', 'adminForm', strtolower($listDirn), $saveOrderingUrl);
|
||||
}
|
||||
$sortFields = $this->getSortFields();
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
|
||||
JFactory::getDocument()->addScriptDeclaration('
|
||||
Joomla.orderTable = function()
|
||||
{
|
||||
table = document.getElementById("sortTable");
|
||||
direction = document.getElementById("directionTable");
|
||||
order = table.options[table.selectedIndex].value;
|
||||
if (order != '<?php echo $listOrder; ?>')
|
||||
if (order != "' . $listOrder . '")
|
||||
{
|
||||
dirn = 'asc';
|
||||
dirn = "asc";
|
||||
}
|
||||
else
|
||||
{
|
||||
dirn = direction.options[direction.selectedIndex].value;
|
||||
}
|
||||
Joomla.tableOrdering(order, dirn, '');
|
||||
}
|
||||
</script>
|
||||
Joomla.tableOrdering(order, dirn, "");
|
||||
};
|
||||
');
|
||||
?>
|
||||
<form action="<?php echo JRoute::_('index.php?option=com_weblinks&view=weblinks'); ?>" method="post" name="adminForm" id="adminForm">
|
||||
<?php if (!empty( $this->sidebar)) : ?>
|
||||
<div id="j-sidebar-container" class="span2">
|
||||
|
Loading…
x
Reference in New Issue
Block a user