This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use Stack Overflow.

Day 13: Autocomplete doen't work

Discussion around this tutorial for symfony 1.0.x

Day 13: Autocomplete doen't work

by maplelin » Wed Sep 01, 2010 4:15 am

Hi guys,

I am new to symfony. I have been leaning the Askeet Tutorial for 2 weeks and now I'm in Day 13. I want to get tag autocomplete when entering something before adding tag. But it just doesn't work. I reviewed the source code of the page and found style 'display' of div where autocompleted result show had been set to 'none'. So maybe that's why I can't see the autocompleted listing. How could I fix this? Here are the source code of the page

<div>Add your own:
<form onsubmit="new Ajax.Updater('question_tags', '/tag_add', {asynchronous:true, evalScripts:false, parameters:Form.serialize(this)}); return false;" action="/tag_add" method="post">
<input name="question_id" id="question_id" value="1" type="hidden">
<input name="tag" id="tag" value="" autocomplete="off" type="text">
<div style="display: none; position: absolute; left: 0px; top: 21px; width: 145px;" id="tag_auto_complete" class="auto_complete">
<ul><li class="selected">girl</li></ul>
<script type="text/javascript">
new Ajax.Autocompleter('tag', 'tag_auto_complete', '/tag_autocomplete', {});
</script> <input name="commit" value="Tag" type="submit"> </form>

Thanks in advanced.
Junior Member
Posts: 1
Joined: Wed Sep 01, 2010 2:58 am

Re: Day 13: Autocomplete doen't work

by halfer » Sat Sep 04, 2010 2:40 pm

No, that sounds ok. By default you don't want to see the drop-down - this should be visible only when the user is typing.

* Have you checked to see if you have any JS errors?
* Do you have Firebug/Firefox installed to watch the AJAX operations?
* Are you using symfony 1.0?
Faithful Member
Posts: 10148
Joined: Mon Jan 30, 2006 1:16 pm
Location: West Midlands, UK