validate numeric range 6-10 digits

Discussion in 'Javascript' started by Rob Wahmann, Feb 9, 2004.

  1. Rob Wahmann

    Rob Wahmann Guest

    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
     
    Rob Wahmann, Feb 9, 2004
    #1
    1. Advertising

  2. JRS: In article <9BEVb.3663$>, seen
    in news:comp.lang.javascript, Rob Wahmann <> 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.
     
    Dr John Stockton, Feb 9, 2004
    #2
    1. Advertising

  3. Rob Wahmann

    Rob Wahmann Guest

    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
     
    Rob Wahmann, Feb 9, 2004
    #3
  4. Rob Wahmann

    Evertjan. Guest

    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)
     
    Evertjan., Feb 9, 2004
    #4
  5. Rob Wahmann

    Evertjan. Guest

    Rob Wahmann wrote on 09 feb 2004 in comp.lang.javascript:
    > Do you have an email address I can reply to?
    > "Evertjan." <> 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)
     
    Evertjan., Feb 9, 2004
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. RSB
    Replies:
    7
    Views:
    32,305
    Hannes Decorte
    Jun 14, 2004
  2. Replies:
    5
    Views:
    985
    X-Centric
    Jun 30, 2005
  3. darrel
    Replies:
    4
    Views:
    870
    darrel
    Jul 19, 2007
  4. jobs

    int to numeric numeric(18,2) ?

    jobs, Jul 21, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    1,022
    =?ISO-8859-1?Q?G=F6ran_Andersson?=
    Jul 22, 2007
  5. Mike Copeland

    Testing for Numeric Digits

    Mike Copeland, Feb 26, 2012, in forum: C++
    Replies:
    11
    Views:
    542
    Quint Rankid
    Feb 28, 2012
Loading...

Share This Page