validate numeric range 6-10 digits

R

Rob Wahmann

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
 
D

Dr John Stockton

JRS: In article <[email protected]>, seen
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>
 
R

Rob Wahmann

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
 
E

Evertjan.

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

I'm willing to pay if someone could help me

me !!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,019
Latest member
RoxannaSta

Latest Threads

Top