符号的jquery验证 [英] jquery validation for symbols

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

问题描述



我需要删除字符串第一个字符中的特殊字符。怎么做?

Hi,
I need to remove special characters in the first character of the string. How to do this?

推荐答案

hi,





var string = "I'm a very^ we!rd* Str!ng.";


' body')。html( string .replace(/ [^ a-z0-9 \ s ] / gi,' ')。replace(/ [_ \ s] / g,' - ));
('body').html(string.replace(/[^a-z0-9\s]/gi, '').replace(/[_\s]/g, '-'));





一旦通过以下链接..



如何在jquery或javascript的帮助下从字符串中删除特殊字符 [ ^ ]


hi,

plz请看下面的代码,这个解决方案非常适用于你的问题。接下来我要做的就是将变量x拆分成数组,然后检查数组变量'的第一个字符,无论它是符号还是字母。在这个代码下面我给了一个用于将此变量拆分为数组的链接。请仔细检查该链接。






plz go through the below code, this solution is very to ur problem. now next thing what u have to do is split the variable x into array and then check the array variable''s first char whether it is a symbol or alphabet. below this code im giving one more link for splitting this variable to array. plz go through that link also.


<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
    <script type="text/javascript">

        function tSpeedValue() {
            debugger;
            var x = document.getElementById("TextBox1").value;

            alert(x);


        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <input ID="TextBox1"  onblur="tSpeedValue(this)"></input>
    </div>
    </form>
</body>
</html>







http://roseindia.net/java/javascript-array/javascript-array-string.shtml [ ^ ]


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

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