The HTML on the page has 20 fields each named and given ID\'s in increasing order from 1 to 20.
If the variable id is set to
id
replace
$("#"+id).select();
by
$("#"+id).focus();
or even by
$(this).focus();