dsh7623
2014-08-26 06:40
浏览 38

如何允许在php中输入textarea?

I am using textarea in form in php.I have added validation through javascript function but it does not allow me to press enter key in textarea.I want to add to able enter key in textarea. What should i do?

<script type="text/javascript">
$.validator.addMethod('special', function(value) {
    return value.match(/^[ +,A-Za-z0-9_@./#-]+$/);
});
</script>

Please help me. Thanks in advance....

  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • doushang7209 2014-08-26 06:42
    已采纳

    Include (newline) in the regexp:

    $.validator.addMethod('special', function(value) {
        return value.match(/^[
     +,A-Za-z0-9_@./#-]+$/);
    });
    
    打赏 评论

相关推荐 更多相似问题