Forums

Very slow dynamic dropdown list

dangee 02 Sep, 2015
Hello everyone,

I have setup a form which load all the cities in France in a dynamic dropdown (from DB). In addition with the chosen jquery script, that makes a very nice multi-select dropdown as you can see here see 'choisissez vos villes'

But it seems that loading that amount of datas (+36000 cities) is too hard to handle for chronoforms and the form gets unusable (more on firefox than chrome for some reasons).

Does anyone know what can i do to speed the whole thing and make the form usable ?

Big thanks,

Dan
dangee 02 Sep, 2015
I can't find the edit button...I forgot to tell that the field is called "choisissez vos villes" in the form๐Ÿ˜‰
GreyHead 02 Sep, 2015
Hi Dan,

I think that the answer is not to try to load all 36,000 names. You can use an AutoCompleter that will send a query back after three characters - that way there will only be a few hundred names to load.

Bob
dangee 03 Sep, 2015
Thanks GreyHead,

Is there any documentation on how to use the AutoCompleter ?

Regards,

Dan.
GreyHead 05 Sep, 2015
Hi Dan,

None that I can see. It's fairly straightforward.

You add the AutoCompleter action to the form On Load event - before the HTML (Render form) action.

Add a new event to the form called say ajax_ac and add actions to that to read the data from a table based on the data entered in the form. You can use a DB Read + Custom Code or just Custom Code. The returned data needs to be a json_encoded array.

Then complete the settings for the AutcoCompleter action. The AJAX URL will look like
http://mydomain.com/index.php?option=com_chronoforms5&chronoform=form_name&tvout=ajax 
ChronoForms will add something like &tag=xxx to this to pass the user entry back to the ajax_ac event.

Bob
Fawaaz 09 Sep, 2015
Hello Dangee,

I have checked your website and it seems that you have been able to do the autocompleter.
Do you mind sharing the solution?๐Ÿ˜‰
Merci d'avance.


Regards,
This topic is locked and no more replies can be posted.