PHP 使用trim()将传递过来的值过滤空格
JS 使用
function checkform()
{
var isNull = /^[\s' ']+$/;
if (isNull.test($("input[name='data[title]']").val())) {
alert('Title could not be empty');
return false;
};
}
PHP 使用trim()将传递过来的值过滤空格
JS 使用
function checkform()
{
var isNull = /^[\s' ']+$/;
if (isNull.test($("input[name='data[title]']").val())) {
alert('Title could not be empty');
return false;
};
}
转载于:https://my.oschina.net/fragile/blog/203178