use jQuery to refactor validateRequired()