多行文本框的验证表达式 [英] validation expression for multiline textbox

查看:85
本文介绍了多行文本框的验证表达式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

多行文本框的验证表达式允许使用特殊字符,但不能使用字符.

validation expression for multiline textbox allowed special char but not allowed character.

推荐答案

将此JavaScript函数与文本框控件的onkeypress事件一起使用
即CS中的onKeyPress ="return checkCharacters(event)"

Use this javascript function with your textbox control onkeypress event
i.e. onKeyPress="return checkCharacters(event)" in CS

function checkCharacters(evt) {
    evt = (evt) ? evt : window.event
    var charCode = (evt.which) ? evt.which : evt.keyCode
    if (charCode != 32 && charCode > 31 && (charCode < 65 || charCode > 90) && (charCode < 97 || charCode > 122)) {
        status = "This field accepts numbers only."
        return false
    }

    status = ""
    var name = document.getElementById("txtloginID");
    name.innerHTML = Server.HtmlDecode(name);
    return true
}



希望对您有所帮助



hope this will help you thanks


这篇关于多行文本框的验证表达式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆