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


Groups > comp.lang.javascript > #18128

Re: How can I validate this with regular expression

From Gregor Kofler <usenet@gregorkofler.com>
Newsgroups comp.lang.javascript
Subject Re: How can I validate this with regular expression
Date 2013-01-17 16:45 +0100
Organization A noiseless patient Spider
Message-ID <kd96b2$2i8$1@dont-email.me> (permalink)
References <kd8naj$6pg$1@dont-email.me>

Show all headers | View raw


Am 2013-01-17 12:29, Tony meinte:
> 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.');
>

Ask in a jQuery support forum.

It could be called upon various UI events like blur or keydown, or on 
the forms submit event. Perhaps your validating function is never 
called, because other jQuery "components" must be activated.

See - a jQuery forum is the place to go.

Gregor

Back to comp.lang.javascript | Previous | Next — Previous in thread | 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