I have the following code, which works nicely:
$('#register form .submit input').click(function(){
if(jQuery.trim($('#new-usr').val()) == '' || jQuery.trim($('#new-pwd').val()) == '' || jQuery.trim($('#new-pwd-confirm').val()) == ''){
alert('Please fill in every required field (marked with an asterisk)');
return false;
}
});
However, I have a lot more fields to add to this and was thinking that there must be a way of storing the input ids in an array and looping through them, rather than adding a jquery.trim($('#inputid').val()) == '' for each one.
The jQuery validation plugin is a no-go in this instance for reasons that are too boring to go into here.