Fixed form submit in search input field

form submit in
This commit is contained in:
Andre Lorbach 2014-10-23 11:27:44 +02:00
parent 17e1280927
commit 402b229651
2 changed files with 16 additions and 5 deletions

View File

@ -438,7 +438,6 @@ function HoverPopupMenuHelp( myEvent, parentObj, myPopupTitle, HoverContent )
/* /*
* New JQUERY Helper functions * New JQUERY Helper functions
*/ */
function CreateMenuFunction ( szbuttonobjid, szmenuobjid, bHide ) function CreateMenuFunction ( szbuttonobjid, szmenuobjid, bHide )
{ {
// Popup Menu Code // Popup Menu Code
@ -573,4 +572,16 @@ function CreateLoadingHelper ( szLoadingText )
} }
}); });
})(jQuery); })(jQuery);
} }
function MoveToButtonOnKeypress ( szButton, event )
{
if (event.keyCode == 13) {
event.preventDefault();
$( "#" + szButton ).focus();
$( "#" + szButton ).click();
$("#loading_dialog").loading();
return false;
}
}

View File

@ -27,7 +27,7 @@
<!-- ENDIF EnablePredefinedSearches="true" --> <!-- ENDIF EnablePredefinedSearches="true" -->
<td align="center" nowrap valign="top"> <td align="center" nowrap valign="top">
<td nowrap align="center" nowrap valign="top"> <td nowrap align="center" nowrap valign="top">
<input maxlength="2048" name="filter" size="80" title="Search" value="{searchstr_htmlform}" class="ui-widget-content SearchFormTextbox"> <input maxlength="2048" name="filter" size="80" title="Search" value="{searchstr_htmlform}" class="ui-widget-content SearchFormTextbox" onkeypress="MoveToButtonOnKeypress('buttonsearch', window.event);">
</br> </br>
<button id="buttonsearch"><span class="ui-icon ui-icon-search" title="{LN_SEARCH}" style="float:left;"></span><span class="ui-button-text">{LN_SEARCH}</span></button> <button id="buttonsearch"><span class="ui-icon ui-icon-search" title="{LN_SEARCH}" style="float:left;"></span><span class="ui-button-text">{LN_SEARCH}</span></button>
<!-- IF enabledoraclesearchstr="true" --> <!-- IF enabledoraclesearchstr="true" -->
@ -41,8 +41,8 @@
// Custom Buttons // Custom Buttons
$("#buttonsearch").button() $("#buttonsearch").button()
.click(function() { .click(function() {
// Perform Button Click now! // Perform Form Submit! Click now!
window.location.href = $(ui.item).find('form').submit(); $("#searchform").submit();
// Make sure to return false here or the click registration above gets invoked. // Make sure to return false here or the click registration above gets invoked.
return false; return false;
}) })