这是我的 HTML
<input data-provide="typeahead" type="text" id="actor" name="actor" autofocus="autofocus" maxlength="30" value="" required="required">
我正在使用 Ajax 作为源代码:
actors = getActors();
$('#actor').typeahead({
source: actors,
items: 10
});
如果我保留我的输入div
id,actor
那么一切都会正常工作,但如果将DIV
id 从更改actor
为actor[]
thentypeahead
则不起作用。
对于actor[]
id 我的代码是:
<input data-provide="typeahead" type="text" id="actor[]" name="actor" autofocus="autofocus" maxlength="30" value="" required="required" >
actors = getActors();
$('#actor[]').typeahead({
source: actors,
items: 10
});
如果有人知道这种类型输入的解决方案,ID
请提供您的解决方案。