Try this, without duplicate ID's but class instead.
jQuery
$(document).on('keypress','.fetchChatMsg', function(e) {
if(e.which==13)
alert(this.value);
});
HTML
<input type="text" class="fetchChatMsg" name="chat" />
<input type="text" class="fetchChatMsg" name="chat" />
<input type="text" class="fetchChatMsg" name="chat" />
<input type="text" class="fetchChatMsg" name="chat" />