Check out the LimeSurvey source code on GitHub!

Survey search using autocomplete

More
2 years 11 months ago #106694 by fhmessas
Hi, I'm new here and I have to create a plugin for search surveys bu their title using autocomplete feature.
What's the best way to create It, I couldn't find examples of plugin development.

Thanks and best regards!

Please Log in to join the conversation.

More
2 years 11 months ago #106730 by DenisChenu
Already done in LS core.

But here, just need some javascript : jqueryui.com/autocomplete/#combobox

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).

Please Log in to join the conversation.

More
2 years 11 months ago #106739 by fhmessas
Hi Denis,
Thanks for your reply.
Actualy I can't find any document about which method/controller to call it from view, could you tell me where can I find It?

Please Log in to join the conversation.

More
2 years 11 months ago #106740 by DenisChenu
I say it's already in LS core, take a look at the survey dropdown in Plugin settings.

This is not callable with Plugin.

And : you don't really need a plugin here : just some javascripting.

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).
The following user(s) said Thank You: fhmessas

Please Log in to join the conversation.

More
2 years 10 months ago #106825 by fhmessas
Could you please tell me which method should I invoke by script?

Please Log in to join the conversation.

More
2 years 10 months ago - 2 years 10 months ago #106834 by Ben_V
Hi
If you just are looking for something like this ,

in the surveylist.pstpl file of your default template, implement the following changes:

1. Place your text field
2. Wrap {SURVEYLIST} placeholder into ul or ol element with the related class
3. Add javascript snippet
	<input placeholder="Quick Search" id="quicksearch" type="text" /> 
 
        <ul class="surveysList">
        {SURVEYLIST}
        </ul>
 
	<script type='text/javascript' >
		$('#quicksearch').keyup(function(){
			var valThis = $(this).val().toLowerCase();
				$('.surveysList>li').each(function(){
     				var text = $(this).text().toLowerCase();
        			(text.indexOf(valThis) == 0) ? $(this).show() : $(this).hide();            
   			});
		});
	</script>

Ben

BenoƮt

EM Variables => bit.ly/1TKQyNu | EM Roadmap => bit.ly/1UTrOB4
Last Releases => 2.6x.x goo.gl/ztWfIV | 2.06/2.6.x => bit.ly/1Qv44A1
Demo Surveys => goo.gl/HuR6Xe (already included in /docs/demosurveys)
Last Edit: 2 years 10 months ago by Ben_V.
The following user(s) said Thank You: DenisChenu, fhmessas

Please Log in to join the conversation.

Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form