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

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!us.feeder.erje.net!newsfeed.straub-nv.de!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail
From Gregor Kofler <usenet@gregorkofler.com>
Newsgroups comp.lang.javascript
Subject Re: How can I validate this with regular expression
Date Thu, 17 Jan 2013 16:45:38 +0100
Organization A noiseless patient Spider
Lines 31
Message-ID <kd96b2$2i8$1@dont-email.me> (permalink)
References <kd8naj$6pg$1@dont-email.me>
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
Injection-Date Thu, 17 Jan 2013 15:45:38 +0000 (UTC)
Injection-Info mx04.eternal-september.org; posting-host="83efc9bd06e089a92023c3cb1afcb913"; logging-data="2632"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19KbekB2MofpYNTmeAgXmR6a0CBu1OUcL8="
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130106 Thunderbird/17.0.2
In-Reply-To <kd8naj$6pg$1@dont-email.me>
Cancel-Lock sha1:XB1PBMkpwEv2vRKgkMqDVG2aWW0=
Xref csiph.com comp.lang.javascript:18128

Show key headers only | 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