Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > validate numeric range 6-10 digits

Reply
Thread Tools

validate numeric range 6-10 digits

 
 
Rob Wahmann
Guest
Posts: n/a
 
      02-09-2004
Not sure if my first message went through because of the attachment...

I'm currently using formchek.js to validate various form fields, however, I
cannot figure out how to validate a field with a numeric range of 6-10
digits. I apologize in advance for asking such a question since I'm using
formchek.js, but my strength is server-side programming not JavaScript. I
appreciate any tips or advice you can provide!

TIA - Rob


 
Reply With Quote
 
 
 
 
Dr John Stockton
Guest
Posts: n/a
 
      02-09-2004
JRS: In article <9BEVb.3663$(E-Mail Removed)>, seen
in news:comp.lang.javascript, Rob Wahmann <(E-Mail Removed)> posted
at Mon, 9 Feb 2004 05:08:21 :-

>Not sure if my first message went through because of the attachment...


Attachments are unwelcome, or worse.

>I'm currently using formchek.js to validate various form fields, however, I
>cannot figure out how to validate a field with a numeric range of 6-10
>digits. I apologize in advance for asking such a question since I'm using
>formchek.js, but my strength is server-side programming not JavaScript. I
>appreciate any tips or advice you can provide!


formchek.js not known.

OK = /^\d{6,10}$/.test(field)

<URL:http://www.merlyn.demon.co.uk/js-valid.htm>

--
John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4
<URL:http://jibbering.com/faq/> Jim Ley's FAQ for news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.
 
Reply With Quote
 
 
 
 
Rob Wahmann
Guest
Posts: n/a
 
      02-09-2004
I'm willing to pay if someone could help me figure out these two functions.
I know one is already written but I don't know how to call it. The other
check is to make sure the field has 6-10 digits within it. I'd like to keep
everything wrapped up in the formchek.js file if possible. Let me know if
you can help!

Thanks!

Rob


 
Reply With Quote
 
Evertjan.
Guest
Posts: n/a
 
      02-09-2004
Rob Wahmann wrote on 09 feb 2004 in comp.lang.javascript:
> I'm currently using formchek.js to validate various form fields,
> however, I cannot figure out how to validate a field with a numeric
> range of 6-10 digits. I apologize in advance for asking such a
> question since I'm using formchek.js, but my strength is server-side
> programming not JavaScript. I appreciate any tips or advice you can
> provide!


<script type="text/javascript">

function testfor6210digits(x){
return /^\d{6,10}$/.test(x)
}

alert(testfor6210digits("0123456")) // true
alert(testfor6210digits("01234567890")) // false
alert(testfor6210digits("0123abc")) // false
alert(testfor6210digits("123")) // false

</script>

> I'm willing to pay if someone could help me


me !!!


--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
 
Reply With Quote
 
Evertjan.
Guest
Posts: n/a
 
      02-09-2004
Rob Wahmann wrote on 09 feb 2004 in comp.lang.javascript:
> Do you have an email address I can reply to?
> "Evertjan." <(E-Mail Removed)> wrote in message
>> (Please change the x'es to dots in my emailaddress)



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

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Testing for Numeric Digits Mike Copeland C++ 11 02-28-2012 07:43 PM
int to numeric numeric(18,2) ? jobs ASP .Net 2 07-22-2007 12:32 AM
Arithmetic overflow error converting numeric to data type numeric. darrel ASP .Net 4 07-19-2007 09:57 PM
check if string contains numeric, and check string length of numeric value ief@specialfruit.be C++ 5 06-30-2005 01:08 PM
how to validate a textBox for 0-9 Digits only RSB ASP .Net 7 06-14-2004 06:50 PM



Advertisments