Commit 4173d8db authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

pass form itself instead of passing a hardcoded form id.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@26486 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 0f9badc9
...@@ -126,7 +126,7 @@ ...@@ -126,7 +126,7 @@
<fieldset id="fieldset-tiosearch">\n <fieldset id="fieldset-tiosearch">\n
<input type="hidden" name="all_languages" value="1" />\n <input type="hidden" name="all_languages" value="1" />\n
<input accesskey="4" type="text" size="40" name="field_your_search_text" class="input-text" \n <input accesskey="4" type="text" size="40" name="field_your_search_text" class="input-text" \n
onkeypress="submitFormOnEnter(event, \'main_form\', \'ERP5Site_viewQuickSearchResultList\');" />\n onkeypress="submitFormOnEnter(event, this.form, \'ERP5Site_viewQuickSearchResultList\');" />\n
<input type="submit" class="input-submit" value="" alt="Search"\n <input type="submit" class="input-submit" value="" alt="Search"\n
name="ERP5Site_viewQuickSearchResultList:method"/> \n name="ERP5Site_viewQuickSearchResultList:method"/> \n
</fieldset>\n </fieldset>\n
......
32 33
\ No newline at end of file \ No newline at end of file
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
tal:define="dummy python: request.RESPONSE.setHeader(\'Content-Type\', \n tal:define="dummy python: request.RESPONSE.setHeader(\'Content-Type\', \n
\'text/html;; charset=utf-8\');">\n \'text/html;; charset=utf-8\');">\n
<div>\n <div>\n
<input type="text" onkeypress="submitFormOnEnter(event, \'main_form\', \'ERP5Site_processAdvancedSearch\');" class="input-text" name="top_your_search_text" size="40" accesskey="4"/>\n <input type="text" onkeypress="submitFormOnEnter(event, this.form, \'ERP5Site_processAdvancedSearch\');" class="input-text" name="top_your_search_text" size="40" accesskey="4"/>\n
<select size="1" class="input" name="top_your_search_portal_type">\n <select size="1" class="input" name="top_your_search_portal_type">\n
<option value="" selected="selected" i18n:translate="" i18n:domain="ui">Everything</option>\n <option value="" selected="selected" i18n:translate="" i18n:domain="ui">Everything</option>\n
<option value="all" i18n:translate="" i18n:domain="ui">All Documents</option>\n <option value="all" i18n:translate="" i18n:domain="ui">All Documents</option>\n
......
...@@ -83,7 +83,7 @@ ...@@ -83,7 +83,7 @@
tal:condition="python:here.getParamDict().has_key(\'your_search_text\')"\n tal:condition="python:here.getParamDict().has_key(\'your_search_text\')"\n
type="text"\n type="text"\n
onkeypress="submitFormOnEnter(event, \n onkeypress="submitFormOnEnter(event, \n
\'main_form\',\n this.form,\n
\'ERP5Site_processAdvancedSearch\');"\n \'ERP5Site_processAdvancedSearch\');"\n
tal:attributes="value python:here.getParamDict()[\'your_search_text\']"/>\n tal:attributes="value python:here.getParamDict()[\'your_search_text\']"/>\n
\n \n
...@@ -93,7 +93,7 @@ ...@@ -93,7 +93,7 @@
tal:condition="python:not here.getParamDict().has_key(\'your_search_text\')"\n tal:condition="python:not here.getParamDict().has_key(\'your_search_text\')"\n
type="text"\n type="text"\n
onkeypress="submitFormOnEnter(event, \n onkeypress="submitFormOnEnter(event, \n
\'main_form\',\n this.form,\n
\'ERP5Site_processAdvancedSearch\');">\n \'ERP5Site_processAdvancedSearch\');">\n
\n \n
<input class="button" \n <input class="button" \n
...@@ -360,7 +360,7 @@ ...@@ -360,7 +360,7 @@
tal:condition="python:here.getParamDict().has_key(\'your_search_text\')"\n tal:condition="python:here.getParamDict().has_key(\'your_search_text\')"\n
type="text" \n type="text" \n
onkeypress="submitFormOnEnter(event, \n onkeypress="submitFormOnEnter(event, \n
\'main_form\',\n this.form,\n
\'ERP5Site_processAdvancedSearchBottom\');"\n \'ERP5Site_processAdvancedSearchBottom\');"\n
tal:attributes="value python:here.getParamDict()[\'your_search_text\']"/>\n tal:attributes="value python:here.getParamDict()[\'your_search_text\']"/>\n
\n \n
...@@ -370,7 +370,7 @@ ...@@ -370,7 +370,7 @@
tal:condition="python:not here.getParamDict().has_key(\'your_search_text\')"\n tal:condition="python:not here.getParamDict().has_key(\'your_search_text\')"\n
type="text"\n type="text"\n
onkeypress="submitFormOnEnter(event, \n onkeypress="submitFormOnEnter(event, \n
\'main_form\',\n this.form,\n
\'ERP5Site_processAdvancedSearchBottom\');"/>\n \'ERP5Site_processAdvancedSearchBottom\');"/>\n
\n \n
<input class="button" \n <input class="button" \n
......
...@@ -430,7 +430,7 @@ ...@@ -430,7 +430,7 @@
<input name="advanced_search_text" size="40" value=""\n <input name="advanced_search_text" size="40" value=""\n
type="text" tal:attributes="value python:here.getParamDict()[\'advanced_search_text\']"\n type="text" tal:attributes="value python:here.getParamDict()[\'advanced_search_text\']"\n
onkeypress="submitFormOnEnter(event,\n onkeypress="submitFormOnEnter(event,\n
\'main_form\',\n this.form,\n
\'ERP5Site_processAdvancedSearch\');"/>\n \'ERP5Site_processAdvancedSearch\');"/>\n
<input class="button" value="Search" name="ERP5Site_processAdvancedSearch:method" type="submit" />\n <input class="button" value="Search" name="ERP5Site_processAdvancedSearch:method" type="submit" />\n
\n \n
......
...@@ -183,11 +183,11 @@ function fixLeftRightHeightAndFocus(fix_height) {\n ...@@ -183,11 +183,11 @@ function fixLeftRightHeightAndFocus(fix_height) {\n
\n \n
// This function can be used to catch ENTER pressed in an input \n // This function can be used to catch ENTER pressed in an input \n
// and modify respective main form action\n // and modify respective main form action\n
function submitFormOnEnter(event, main_form_id, method_name){\n function submitFormOnEnter(event, form, method_name){\n
var key_code = event.keyCode;\n if(event.keyCode == 13){\n
if(key_code == 13){\n form.action = method_name;\n
var main_form = getElement(main_form_id)\n form.submit();\n
main_form.action=method_name;};\n }\n
}\n }\n
\n \n
var old_index=0;\n var old_index=0;\n
......
...@@ -122,7 +122,7 @@ ...@@ -122,7 +122,7 @@
<span id="search">\n <span id="search">\n
<input type="hidden" name="all_languages" value="1" />\n <input type="hidden" name="all_languages" value="1" />\n
<input accesskey="4" type="text" name="field_your_search_text" \n <input accesskey="4" type="text" name="field_your_search_text" \n
onkeypress="submitFormOnEnter(event, \'main_form\', \'ERP5Site_viewQuickSearchResultList\');" />\n onkeypress="submitFormOnEnter(event, this.form, \'ERP5Site_viewQuickSearchResultList\');" />\n
<button type="submit" name="ERP5Site_viewQuickSearchResultList:method" title="Search"\n <button type="submit" name="ERP5Site_viewQuickSearchResultList:method" title="Search"\n
i18n:attributes="title" i18n:domain="ui">\n i18n:attributes="title" i18n:domain="ui">\n
<span class="image"></span>\n <span class="image"></span>\n
......
710 711
\ No newline at end of file \ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment