From 23424e56aea4f2a1a098b9daf3296c497486ac08 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 7 Feb 2011 14:15:56 +0000 Subject: [PATCH] Fix: automatic selection when it was found that a value becomes an option, as can cause problems when creating --- htdocs/lib/ajax.lib.php | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/htdocs/lib/ajax.lib.php b/htdocs/lib/ajax.lib.php index 8f39d8593be..132f5f8c7a6 100644 --- a/htdocs/lib/ajax.lib.php +++ b/htdocs/lib/ajax.lib.php @@ -1,6 +1,6 @@ - * Copyright (C) 2007-2010 Regis Houssin + * Copyright (C) 2007-2011 Regis Houssin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -30,15 +30,17 @@ * @param htmlname HTML name of input field * @param url Url for request: /chemin/fichier.php * @param option More parameters on URL request - * @param minLength Minimum number of chars to trigger tha Ajax search + * @param minLength Minimum number of chars to trigger that Ajax search + * @param autoselect Automatic selection if just one value * @return string script complet */ -function ajax_autocompleter($selected='',$htmlname,$url,$option='',$minLength=2) +function ajax_autocompleter($selected='',$htmlname,$url,$option='',$minLength=2,$autoselect=0) { $script = ''; $script.= '