Welcome, Guest
Username: Password: Remember me

TOPIC: Survey search using autocomplete

Survey search using autocomplete 4 months 4 days ago #106694

  • fhmessas
  • fhmessas's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 3
  • Karma: 0
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!
The administrator has disabled public write access.

Survey search using autocomplete 4 months 4 days ago #106730

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 6228
  • Thank you received: 793
  • Karma: 238
Already done in LS core.

But here, just need some javascript : jqueryui.com/autocomplete/#combobox
The administrator has disabled public write access.

Survey search using autocomplete 4 months 4 days ago #106739

  • fhmessas
  • fhmessas's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 3
  • Karma: 0
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?
The administrator has disabled public write access.

Survey search using autocomplete 4 months 4 days ago #106740

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 6228
  • Thank you received: 793
  • Karma: 238
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.
The administrator has disabled public write access.
The following user(s) said Thank You: fhmessas

Survey search using autocomplete 4 months 2 days ago #106825

  • fhmessas
  • fhmessas's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 3
  • Karma: 0
Could you please tell me which method should I invoke by script?
The administrator has disabled public write access.

Survey search using autocomplete 4 months 2 days ago #106834

  • Ben_V
  • Ben_V's Avatar
  • OFFLINE
  • Platinum Lime
  • Posts: 1061
  • Thank you received: 234
  • Karma: 74
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

goo.gl/Bw5iM => Recherche GG dans le forum français (remplacer "exemple" dans la barre de recherche)
goo.gl/WX8PH => GG search for english forum (Replace "example" in the search bar)
goo.gl/IxiGu => Búsqueda en el foro en español (Cambiar "ejemplo" en la barra de...
Last Edit: 4 months 2 days ago by Ben_V.
The administrator has disabled public write access.
The following user(s) said Thank You: DenisChenu, fhmessas
Moderators: ITEd
Time to create page: 0.163 seconds
Donation Image