I have inputbox like this:
&l
This should do it:
$( '[id^="namecity"]' ).autocomplete( 'states.php' ).result( function (e, data) { $( this ).next().val( data[1] ); });