jQuery textarea验证 [英] jquery textarea validation
本文介绍了jQuery textarea验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在使用jquery验证textarea的同时检查空,空格和换行. 如果textarea为空,并且只有新行或空格应发出警报
How to check for null,white spaces and new lines while validating for a textarea using jquery. If the textarea is empty and has only new lines or spaces should raise an alert
推荐答案
if($.trim($('#myTextArea').val()) == '') {
//error
}
这篇关于jQuery textarea验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文