if($('#term').val() == ""){ alert("empty"); //do something }else{ alert($('#term').val()); //do something }
On Nov 22, 3:32 am, coughlinsmyalias <[EMAIL PROTECTED]> wrote: > Hey, > > I have been trying to look for a simple way to validate one field, if > its empty then do X, how would I check? I have this: > > term = $('#term').attr('value'); > > Would I check if term is empty? Then don't allow the submit, my code > is here:http://pastie.org/320870 > > Any thoughts? > > Thanks, > > Ryan