Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8493207
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T22:56:30+00:00 2026-06-10T22:56:30+00:00

I would usually include a decent amount of code along with what I have

  • 0

I would usually include a decent amount of code along with what I have tried, but for this one I don’t really know where to begin.

To cut a long story short, what I need is to do display a <div> (or any other element) after 6 numbers have been entered in an <input> field, I also need to trim the white space so if someone enters 2 spaces (or 2 letters) the <div> wont display until they have entered 6 numbers.

I know how to do everything else I’m just not sure how to check if the input contains 6 numbers, stripping every other character.

I’m guessing I need some sort of regex?!?

If anyone can give me a nudge in the right direction I can update the question with more info once I’ve tried something.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T22:56:31+00:00Added an answer on June 10, 2026 at 10:56 pm

    Try this:

    $('input').keyup(function(){
       var len = this.value.match(/\d/g).length;
       if (len === 6) {
           // do something
       } 
    })
    

    http://jsfiddle.net/ZY4cf/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When performing many inserts into a database I would usually have code like this:
I usually would include a lot of code with my questions but I'm not
For this code example below, usually I would use [self fall]; instead of the
I would usually search for this error. But in VS C++ Express, this error
I know of the include() code, but I want the iframes to change. In
How would I usually represent this business logic in a graph? A is true
I have a URL that would be like so: http://mysite.com/index.php?somename=somevalue I usually check that
First of all, I know how extend and include work, and what they're usually
I usually include my namespaces e.g. using myProject.Model; to my .cs files but when
Usually in a django view you would do something like queryset = MyModel.objects.something() How

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.