* All Applications: Get browser autocomplete form working

This commit is contained in:
Hadi Nategh 2015-01-26 16:13:08 +00:00
parent 21d52f5cee
commit ebab506aa9
2 changed files with 7 additions and 1 deletions

View File

@ -225,7 +225,8 @@ class etemplate_new extends etemplate_widget_template
{
$load_array['response'] = egw_json_response::get()->returnResult();
}
echo '<div id="'.$dom_id.'" class="et2_container" data-etemplate="'.html::htmlspecialchars(egw_json_response::json_encode($load_array), true).'"></div>';
// <iframe> and <form> tags added only to get browser autocomplete handling working again
echo '<iframe name="egw_iframe_autocomplete_helper" src="about:blank" style="display:none;"></iframe><form id="egw_form_autocomplete_helper" target="egw_iframe_autocomplete_helper" action="about:blank" method="get"><div id="'.$dom_id.'" class="et2_container" data-etemplate="'.html::htmlspecialchars(egw_json_response::json_encode($load_array), true).'"></div></form>';
if ($output_mode == 2)
{

View File

@ -657,6 +657,11 @@ etemplate2.prototype.submit = function(button, async, no_validation)
var api = this.widgetContainer.egw();
var request = api.json(this.menuaction, [this.etemplate_exec_id, values, no_validation], null, this, async);
request.sendRequest();
// Submit the template to an empty iframe (egw_iframe_autocomplete_helper)
// in order to get default browser autocomplete working
// maybe later we find better solution then we can remove this part
jQuery("form#egw_form_autocomplete_helper").submit();
}
else
{