Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #18123

How can I validate this with regular expression

From "Tony" <tony.johansson@inport.com>
Newsgroups comp.lang.javascript
Subject How can I validate this with regular expression
Date 2013-01-17 12:29 +0100
Organization A noiseless patient Spider
Message-ID <kd8naj$6pg$1@dont-email.me> (permalink)

Show all headers | View raw


Hello!

I'm new to JavaScript and JQuery.
Have earlier worked with ASP.NET.
I have this html input
<input type="text"  name="depthBow" id="txtDepthBow" size="20"  />

I have written this addMethod that should validate the format but I have two 
questions.
1. Where should this be put.
2.When will this be called

As I said this is new to me.

  $.validator.addMethod('txtDepthBow', function (value)
            {
                return /^(\d{1,2}(\.d{1,2})?)$/.test(value);
            }, 'Wrong input.');

//Tony 

Back to comp.lang.javascript | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

How can I validate this with regular expression "Tony" <tony.johansson@inport.com> - 2013-01-17 12:29 +0100
  Re: How can I validate this with regular expression Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-01-17 13:46 +0100
    Re: How can I validate this with regular expression John G Harris <niam@jghnorth.org.invalid> - 2013-01-17 14:41 +0000
  Re: How can I validate this with regular expression Gregor Kofler <usenet@gregorkofler.com> - 2013-01-17 16:45 +0100
  Re: How can I validate this with regular expression Danny <dann90038@gmail.com> - 2013-01-18 13:00 -0800
    Re: How can I validate this with regular expression "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2013-01-19 15:19 +0100

csiph-web