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


Groups > comp.lang.javascript > #18123 > unrolled thread

How can I validate this with regular expression

Started by"Tony" <tony.johansson@inport.com>
First post2013-01-17 12:29 +0100
Last post2013-01-19 15:19 +0100
Articles 6 — 6 participants

Back to article view | Back to comp.lang.javascript


Contents

  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

#18123 — How can I validate this with regular expression

From"Tony" <tony.johansson@inport.com>
Date2013-01-17 12:29 +0100
SubjectHow can I validate this with regular expression
Message-ID<kd8naj$6pg$1@dont-email.me>
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 

[toc] | [next] | [standalone]


#18124

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2013-01-17 13:46 +0100
Message-ID<1871815.Oi8kla96nP@PointedEars.de>
In reply to#18123
Tony wrote:
^^^^
Where did your last name go?

> I'm new to JavaScript and JQuery.

Much you have to learn, young apprentice.

jQuery is the path to the Dark Side.  jQuery leads to bloat.  Bloat leads to 
incompatibility.  Both lead to suffering.

Learn JavaScript first (then ECMAScript, JScript, V8, …), so that you can 
better judge the quality of script code.

<http://jibbering.com/faq/>
<http://PointedEars.de/faq>

-- 
PointedEars

Twitter: @PointedEars2
Please do not Cc: me. / Bitte keine Kopien per E-Mail.

[toc] | [prev] | [next] | [standalone]


#18127

FromJohn G Harris <niam@jghnorth.org.invalid>
Date2013-01-17 14:41 +0000
Message-ID<x6mbUuER2A+QFwOs@J.A830F0FF37FB96852AD08924D9443D28E23ED5CD>
In reply to#18124
In message <1871815.Oi8kla96nP@PointedEars.de>, Thomas 'PointedEars' 
Lahn wrote:
>Tony wrote:
>^^^^
>Where did your last name go?
   <snip>

A report in The Guardian newspaper [1] says :

"A German state data protection agency has threatened Facebook's 
billionaire founder and chief executive Mark Zuckerberg with a €20,000 
(£16,000) fine if Facebook does not allow Germans to have anonymous 
accounts on the social network."

Why do you think that Usenet is immune from German law ?

   John

[1] <http://www.guardian.co.uk/world/2013/jan/04/facebook-germany-data-protection?INTCMP=SRCH>
-- 
John Harris

[toc] | [prev] | [next] | [standalone]


#18128

FromGregor Kofler <usenet@gregorkofler.com>
Date2013-01-17 16:45 +0100
Message-ID<kd96b2$2i8$1@dont-email.me>
In reply to#18123
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

[toc] | [prev] | [next] | [standalone]


#18135

FromDanny <dann90038@gmail.com>
Date2013-01-18 13:00 -0800
Message-ID<e5729681-e228-4427-bba7-4fd8e2b775c9@googlegroups.com>
In reply to#18123
Tony

    What are you checking for? and What is the specifically the input field for?

[toc] | [prev] | [next] | [standalone]


#18139

From"Evertjan." <exxjxw.hannivoort@inter.nl.net>
Date2013-01-19 15:19 +0100
Message-ID<XnsA14D9BE9C453Ceejj99@194.109.133.133>
In reply to#18135
Danny wrote on 18 jan 2013 in comp.lang.javascript:

> What are you checking for? and What is the specifically the input
> field for? 

Who is "you"?
What are you responding on?

This is usenet, not email nor the web.

-- 
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.javascript


csiph-web