Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Contest-1 BugFix #4053

Signed-off-by: Umair Khan <omerjerk@gmail.com>
  • Loading branch information...
commit 27f616e963ce31430dc3f4b38f62669ebdac587b 1 parent 0aea14a
Umair Khan omerjerk authored
Showing with 25 additions and 1 deletion.
  1. +24 −0 js/rte.js
  2. +1 −1  libraries/rte/rte_routines.lib.php
24 js/rte.js
View
@@ -711,6 +711,30 @@ RTE.ROUTINE = {
$ajaxDialog.find('input.datefield, input.datetimefield').each(function () {
PMA_addDatepicker($(this).css('width', '95%'));
});
+ /*
+ * Define the function if the user presses enter
+ */
+ $('form.rte_form').live('submit', function (event) {
+ event.preventDefault();
+ /**
+ * @var data Form data to be sent in the AJAX request
+ */
+ var data = $(this).serialize();
+ $msg = PMA_ajaxShowMessage(
+ PMA_messages.strProcessingRequest
+ );
+ var url = $(this).attr('action');
+ $.post(url, data, function (data) {
+ if (data.success === true) {
+ // Routine executed successfully
+ PMA_ajaxRemoveMessage($msg);
+ PMA_slidingMessage(data.message);
+ $ajaxDialog.remove();
+ } else {
+ PMA_ajaxShowMessage(data.error, false);
+ }
+ });
+ });
} else {
// Routine executed successfully
PMA_slidingMessage(data.message);
2  libraries/rte/rte_routines.lib.php
View
@@ -1578,7 +1578,7 @@ function PMA_RTN_getExecuteForm($routine)
// Create the output
$retval = "";
$retval .= "<!-- START ROUTINE EXECUTE FORM -->\n\n";
- $retval .= "<form action='db_routines.php' method='post' class='rte_form'>\n";
+ $retval .= "<form action='db_routines.php' method='post' class='rte_form ajax' onsubmit='return false'>\n";
$retval .= "<input type='hidden' name='item_name'\n";
$retval .= " value='{$routine['item_name']}' />\n";
$retval .= "<input type='hidden' name='item_type'\n";
Please sign in to comment.
Something went wrong with that request. Please try again.