$("#FormID input").each(function() { if ($.trim($(this).val()) == "") { $(this).focus(); return false; //exits loop } });
On Feb 4, 2:57 pm, Massiverse <august.massive...@gmail.com> wrote: > Hello > > I'm a newbie, here's what I need to do (searched the forums first but > couldn't find the answer). > > 1. Search form for an empty input field. > 2. If an empty field exists, set the focus on the field. > 3. If no empty fields exist, do nothing. > > Thanks, > > August