Folosesc jqueryui pentru a primit sugestii in input cand incep sa scriu
<script>
$( function() {
var availableTags = [
"ActionScript",
"AppleScript",
"Asp",
"BASIC",
"C",
"C++",
"Clojure",
"COBOL",
"ColdFusion",
"Erlang",
"Fortran",
"Groovy",
"Haskell",
"Java",
"JavaScript",
"Lisp",
"Perl",
"PHP",
"Python",
"Ruby",
"Scala",
"Scheme"
];
$( "#tags" ).autocomplete({
source: availableTags
});
} );
</script>
<div class="ui-widget">
<label for="tags">Tags: </label>
<input id="tags">
</div>
Cand clonez tabelul cu mai multe input-uri nu imi functioneaza autocompletarea, se deschide sugestiile in inputul initial.
$('button.row-add').on("click", function(e) {
e.preventDefault();
var $table = $(this).parents('table');
var $top = $table.find('tr.line_items').last();
var $new = $top.clone(true);
$new.jAutoCalc('destroy');
$new.insertAfter($top);
$new.find('input[type=text]').val('');
autoCalcSetup();
});
Ce as putea sa ii fac?