I am a noivce at JQuery.
I开发者_StackOverflow'm curious about if there is any plug-in or libraries to help developers validate whether any input value over a set of form elements is not entered (empty string).
I can just think of using a function to achieve this feature. Any better idea?
Thanks.
try Validation
Take a look at validate plugins in jQuery
You can implement one, it's not that hard (for strings, at least):
function is_empty(input){
input = input.replace(/\s/g, '');
if(input.length <= 0) return true;
return false;
}
It's simple, small and suits your needs.
You could try YAV, which lets you define the validation rules as HTML labels.
精彩评论