I have a form that can contain a number of elements added via ajax. But when this line is added, new inputs cannot receive focus.
Trying to solve this problem, I found that they get focus if a warning is triggered during the bind function.
I was looking for answers, but I just can't get it to work. I think a “live” function may be related, but I really don't understand how to use it.
Here is my code.
$("#doogal").bind("click", function (event) {
$.ajax({data:$("#doogal").closest("form").serialize(), dataType:"html", success:function (data, textStatus) {$("#saleitems").append(data);}, type:"get", url:"\/saleitems\/add\/" + $rows});
$rows = $rows + 1;
$("#autoComplete_1").focus();
return false;
});
source
share