2 * Unbind all event handlers before tearing down a page
4 AJAX.registerTeardown('tbl_find_replace.js', function () {
5 $('#find_replace_form').unbind('submit');
6 $('#toggle_find').unbind('click');
12 AJAX.registerOnload('tbl_find_replace.js', function () {
14 $('<div id="toggle_find_div"><a id="toggle_find"></a></div>')
15 .insertAfter('#find_replace_form')
19 .html(PMA_messages.strHideFindNReplaceCriteria)
22 $('#find_replace_form').slideToggle();
23 if ($link.text() == PMA_messages.strHideFindNReplaceCriteria) {
24 $link.text(PMA_messages.strShowFindNReplaceCriteria);
26 $link.text(PMA_messages.strHideFindNReplaceCriteria);
31 $('#find_replace_form').submit(function (e) {
33 var findReplaceForm = $('#find_replace_form');
34 PMA_prepareForAjaxRequest(findReplaceForm);
35 var $msgbox = PMA_ajaxShowMessage();
36 $.post(findReplaceForm.attr('action'), findReplaceForm.serialize(), function (data) {
37 PMA_ajaxRemoveMessage($msgbox);
38 if (data.success === true) {
39 $('#toggle_find_div').show();
40 $('#toggle_find').click();
41 $("#sqlqueryresultsouter").html(data.preview);
43 $("#sqlqueryresultsouter").html(data.error);