{% if bootstrap %}{% include "ajax_select/bootstrap.html" %}{% endif %}
<input type="text" name="{{name}}" id="{{html_id}}" value="{{current_repr}}" autocomplete="off" {{ extra_attrs }} />
<script type="text/javascript">//<![CDATA[
jQuery(document).ready(function($){
{% block script %}
	addAutoComplete("{{html_id}}", function(html_id) {
		var opts = {{ plugin_options }};
		opts['select'] =
			function(event, ui) {
				$("#"+html_id).val(ui.item.value).trigger("added");
				return false;
			}
		$("#"+html_id).autocomplete(opts).autocompletehtml();
	});
{% block extra_script %}{% endblock %}
{% endblock %}
});
//]]>
</script>
{% block help %}{% if help_text %}<p class="help">{{ help_text }}</p>{% endif %}{% endblock %}
{{ inline }}
