Loop through each input element in the form, and check if it has a value. If not append the error message to a string which you later alert out if valid is false.
$('#submit').on('click', function() {
var valid = true,
message = '';
$('form input').each(function() {
var $this = $(this);
if(!$this.val()) {
var inputName = $this.attr('name');
valid = false;
message += 'Please enter your ' + inputName + '\n';
}
});
if(!valid) {
alert(message);
}
});