autocomplete_input.pt
761 Bytes
<span tal:define="name name|field.name;
css_class css_class|field.widget.css_class;
oid oid|field.oid;
style style|field.widget.style;
js js|field.widget.js"
tal:omit-tag="">
<input type="text"
name="${name}"
value="${cstruct}"
data-provide="typeahead"
tal:attributes="class string: form-control ${css_class or ''};
style style;
attributes|field.widget.attributes|{};"
id="${oid}"/>
<script tal:condition="field.widget.values" type="text/javascript">
deform.addCallback(
'${field.oid}',
function (oid) {
$('#' + oid).typeahead(${options});
${structure:js}
}
);
</script>
</span>