|
@@ -718,10 +718,11 @@ class FormCompany
|
|
|
* @param string $htmlname HTML select name
|
|
|
* @param string $fields Fields
|
|
|
* @param int $fieldsize Field size
|
|
|
- * @param int $disableautocomplete 1 To disable autocomplete features
|
|
|
+ * @param int $disableautocomplete 1 To disable ajax autocomplete features (browser autocomplete may still occurs)
|
|
|
+ * @param string $moreattrib Add more attribute on HTML input field
|
|
|
* @return string
|
|
|
*/
|
|
|
- function select_ziptown($selected='', $htmlname='zipcode', $fields='', $fieldsize=0, $disableautocomplete=0)
|
|
|
+ function select_ziptown($selected='', $htmlname='zipcode', $fields='', $fieldsize=0, $disableautocomplete=0, $moreattrib='')
|
|
|
{
|
|
|
global $conf;
|
|
|
|
|
@@ -730,8 +731,12 @@ class FormCompany
|
|
|
$size='';
|
|
|
if (!empty($fieldsize)) $size='size="'.$fieldsize.'"';
|
|
|
|
|
|
- if ($conf->use_javascript_ajax && empty($disableautocomplete)) $out.= ajax_multiautocompleter($htmlname,$fields,DOL_URL_ROOT.'/core/ajax/ziptown.php')."\n";
|
|
|
- $out.= '<input id="'.$htmlname.'" type="text" name="'.$htmlname.'" '.$size.' value="'.$selected.'">'."\n";
|
|
|
+ if ($conf->use_javascript_ajax && empty($disableautocomplete))
|
|
|
+ {
|
|
|
+ $out.= ajax_multiautocompleter($htmlname,$fields,DOL_URL_ROOT.'/core/ajax/ziptown.php')."\n";
|
|
|
+ $moreattrib.=' autocomplete="off"';
|
|
|
+ }
|
|
|
+ $out.= '<input id="'.$htmlname.'" type="text"'.($moreattrib?' '.$moreattrib:'').' name="'.$htmlname.'" '.$size.' value="'.$selected.'">'."\n";
|
|
|
|
|
|
return $out;
|
|
|
}
|