se usi jquery 1.7 o superiore .on altrimenti .live attenzione ricordati che gli id devono essere univoci ti consiglio d'usare una classe al posto di [id=comment] e di rendere id appunto unici cronologici tipo comment1, comment2, comment3....codice:$(document).ready (function print_results_others_events() { //write comment when enter is pressed $("body").on('keypress','input [id=comment]',function(event) { var $self = $(this); var comm = $self.val(); var keycode = (event.keycode ? event.keycode : event.which); if (keycode == 13) { //ajax call + write db } }); })

Rispondi quotando