java脚本中的正则表达式验证器 [英] regular expression validator in java script

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

问题描述

你好所有

如何执行这个正则表达式验证器

^ [0-9] {0,9}(\。[0-9] { 0,3})?$
$ b / b by java script

i表示java脚本中的写函数exec

^ [0-9] {0, 9}(\。[0-9] {0,3})?$

这个函数调用on change这样的事件

< input type = textönchange=function name/>

hello to all
how can execute this regular expression validator
^[0-9]{0,9}(\.[0-9]{0,3})?$
by java script
i mean write function in java script exec
^[0-9]{0,9}(\.[0-9]{0,3})?$
and this function call by on change event like this
<input type="text" önchange="function name "/>

推荐答案



by java script

i mean write java脚本中的函数exec

^ [0-9] {0,9}(\。[0-9] {0,3})?

by java script
i mean write function in java script exec
^[0-9]{0,9}(\.[0-9]{0,3})?




这个函数调用此类更改事件

< input type =textönchange=function name/>

and this function call by on change event like this
<input type="text" önchange="function name "/>


您好


您可以使用javascript中提供的test()方法,如下所示:



Hi
You can use the test() method available in javascript like this:

<script>

function check(Cntrl)
{
var str=Cntrl.value;
//look for "Hello"
var patt=/^[0-9]{0,9}(\.[0-9]{0,3})?


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

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