开发者

Is there any plug-in or library to validate a set of form elements?

开发者 https://www.devze.com 2022-12-26 05:41 出处:网络
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 (em

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消