Country list and dropdown autocomplete

Plus d'informations
il y a 1 mois 6 jours - il y a 1 mois 6 jours #181715 par limesurveyfu1
COM_KUNENA_MESSAGE_CREATED_NEW
Hey all,

on my search for a prebuilt "where are you from" country question solution,
I ended up planing to use the country list from surveymonkey and pasting them as answers for a dropdown question.

With the list being quite long I was expecting to find an option in the settings for the dropdown,
which enables autocompletion for the possible dropdown answer options. Sadly I only found
solutions using csv. I simply want to use the answers I already inserted.

Limesurvey has this internally e.g. for lang selection:



1. How I can make a drowdown question searchable/autocomplete (see above)?
2. Is "where are you from" not universal enough to offer this prebuilt?

Version 3.15.9+190214

Thank you very much an greetings from Berlin
FU
Pièces jointes :
Last edit: il y a 1 mois 6 jours by limesurveyfu1.

Connexion ou Créer un compte pour participer à la conversation.

LimeSurvey Partners
Plus d'informations
il y a 1 mois 6 jours - il y a 1 mois 6 jours #181744 par Joffm
COM_KUNENA_MESSAGE_REPLIED_NEW
Hi,
if you do not like the csv, just use an array.
The about 200 countries aren't to many.
And IMO you can exclude some.

Just enter
<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
$('#question{QID} input[type="text"]').autocomplete({
minLength: 2,
source: ["Test1","Test2","Test3"]
});
});
</script>

into your question code of a question type "short text".



Best regards
Joffm


Volunteers are not paid.
Not because they are worthless, but because they are priceless
Pièces jointes :
Last edit: il y a 1 mois 6 jours by Joffm.
Les utilisateur(s) suivant ont remercié: DenisChenu

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 1 mois 5 jours - il y a 1 mois 5 jours #181788 par limesurveyfu1
COM_KUNENA_MESSAGE_REPLIED_NEW
Thank you very much for your quick response.

I don't want to use a "short text", a dropdown perfectly limits the range of possible answers.
I don't like a csv, nor an array, because the possible answers do already exist in the dropdown.
Why you I specify them again?
Last edit: il y a 1 mois 5 jours by limesurveyfu1.

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 1 mois 5 jours - il y a 1 mois 5 jours #181793 par Joffm
COM_KUNENA_MESSAGE_REPLIED_NEW

Why you I specify them again?

Because there is a solution.

And you seem to have an original list. (if not you can download from several websites)
If you do not, but in the drop-down. Then export the survey as "*.txt" and open in EXCEL or OpenOffice. Here you find your drop-down entries.
And to transform this to an array is done in 5 minutes with a small macro.

Or you take this:
["Afghanistan", "Ägypten", "Albanien", "Algerien", "Andorra", "Angola", "Antigua und Barbuda", "Äquatorialguinea", "Argentinien", "Armenien", "Aserbaidschan", "Äthiopien", "Australien", "Bahamas", "Bahrain", "Bangladesch", "Barbados", "Belgien", "Belize", "Benin", "Bergkarabach", "Bhutan", "Bolivien", "Bosnien und Herzegowina", "Botswana", "Brasilien", "Brunei", "Bulgarien", "Burkina Faso", "Burundi", "Chile", "Volksrepublik China", "Cookinseln", "Costa Rica", "Dänemark", "Deutschland", "Dominica", "Dominikanische Republik", "Dschibuti", "Ecuador", "El Salvador", "Elfenbeinküste", "Eritrea", "Estland", "Fidschi", "Finnland", "Frankreich", "Gabun", "Gambia", "Georgien", "Ghana", "Grenada", "Griechenland", "Guatemala", "Guinea", "Guinea-Bissau", "Guyana", "Haiti", "Honduras", "Indien", "Indonesien", "Irak", "Iran", "Irland", "Island", "Israel", "Italien", "Jamaika", "Japan", "Jemen", "Jordanien", "Kambodscha", "Kamerun", "Kanada", "Kap Verde", "Kasachstan", "Katar", "Kenia", "Kirgisistan", "Kiribati", "Kolumbien", "Komoren", "Kongo, Demokratische Republik", "Kongo, Republik", "Korea, Nord", "Korea, Süd", "Kosovo", "Kuba", "Kuwait", "Laos", "Lesotho", "Lettland", "Libanon", "Liberia", "Libyen", "Liechtenstein", "Luxemburg", "Madagaskar", "Malawi", "Malaysia", "Malediven", "Mali", "Malta", "Marokko", "Marshallinseln", "Mauretanien", "Mauritius", "Mazedonien", "Mexiko", "Mikronesien", "Moldawien", "Monaco", "Mongolei", "Montenegro", "Mosambik", "Myanmar", "Namibia", "Nauru", "Nepal", "Neuseeland", "Nicaragua", "Königreich der Niederlande", "Niger", "Nigeria", "Niue", "Nordzypern", "Norwegen", "Oman", "Österreich", "Osttimor / Timor-Leste", "Pakistan", "Palästina", "Palau", "Panama", "Papua-Neuguinea", "Paraguay", "Peru", "Philippinen", "Polen", "Portugal", "Ruanda", "Rumänien", "Russland", "Salomonen", "Sambia", "Samoa", "San Marino", "São Tomé und Príncipe", "Saudi-Arabien", "Schweden", "Schweiz", "Senegal", "Serbien", "Seychellen", "Sierra Leone", "Simbabwe", "Singapur", "Slowakei", "Somalia", "Somaliland", "Spanien", "Sri Lanka", "St. Kitts und Nevis", "St. Lucia", "St. Vincent und die Grenadinen", "Südafrika", "Sudan", "Südossetien", "Südsudan", "Suriname", "Swasiland", "Syrien", "Tadschikistan", "Taiwan", "Tansania", "Thailand", "Togo", "Tonga", "Transnistrien", "Trinidad und Tobago", "Tschad", "Tschechien", "Tunesien", "Türkei", "Turkmenistan", "Tuvalu", "Uganda", "Ukraine", "Ungarn", "Uruguay", "Usbekistan", "Vanuatu", "Vatikanstadt", "Venezuela", "Vereinigte Arabische Emirate", "Vereinigte Staaten", "Vereinigtes Königreich", "Vietnam", "Weißrussland", "Westsahara", "Zentralafrikanische Republik", "Zypern"]

Und es ist flexibel



Regards
Joffm


Volunteers are not paid.
Not because they are worthless, but because they are priceless
Pièces jointes :
Last edit: il y a 1 mois 5 jours by Joffm.

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 1 mois 5 jours #181797 par DenisChenu
COM_KUNENA_MESSAGE_REPLIED_NEW
You can test : gitlab.com/SondagesPro/coreAndTools/select2package

It replace dropdown in survey by select2.org/ if there are more than 15 choice
. Not really tested with 3.X

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .

Connexion ou Créer un compte pour participer à la conversation.

Commencez dès maintenant !

Créez simplement un compte et commencez à utiliser LimeSurvey dès aujourd'hui.

Inscrivez-vous maintenant

Inscrivez-vous à notre Newsletter!