469,328 Members | 1,316 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,328 developers. It's quick & easy.

validate numeric range 6-10 digits

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
Jul 20 '05 #1
5 4012
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
Jul 20 '05 #2
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)
Jul 20 '05 #3
Do you have an email address I can reply to?

Rob

"Evertjan." <ex**************@interxnl.net> wrote in message
news:Xn********************@194.109.133.29...
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)

Jul 20 '05 #4
Rob Wahmann wrote on 09 feb 2004 in comp.lang.javascript:
Do you have an email address I can reply to?
"Evertjan." <ex**************@interxnl.net> 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)
Jul 20 '05 #5
JRS: In article <9B****************@newssvr26.news.prodigy.com>, seen
in news:comp.lang.javascript, Rob Wahmann <ro*@dotcomstudio.biz> 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.
Jul 20 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Stephen Boulet | last post: by
24 posts views Thread by Matt Feinstein | last post: by
2 posts views Thread by MrNobody | last post: by
1 post views Thread by Grey | last post: by
6 posts views Thread by Peter Afonin | last post: by
7 posts views Thread by Sheldon | last post: by
9 posts views Thread by deko | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by Purva khokhar | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.