var $expYears = $('#d_exp_years'); $('.driver_form').on('submit', function (e) { if ($expYears.val() == '') { e.preventDefault(); $expYears.focus(); return; } });