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

  • SEARCH
  • Home
  • 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 8535703
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T10:29:40+00:00 2026-06-11T10:29:40+00:00

With the help of stack overflow i got the below code for text box

  • 0

With the help of stack overflow i got the below code for text box validation on conditions

  1. it must contain atleast 3 characters

  2. it must contain atleast one vowel

  3. it must contain only alphabets

  4. submit button must be enabled only if above 3 condtions are met

    var $input = $('#myinput');
    var $error = $('.error');
    var $submit = $('#submit');
    var Filters = {
        min: {
            re: /.{3,}/,
            error: 'Must be at least 3 characters.'
        },
        char: {
            re: /[a-z]/i,
            error: 'Must be only letters.'
        },
        vowel: {
            re: /[aeiou]/i,
            error: 'Must have at least one vowel.'
        }
    };
    
        function test(value, filters) {
            var isValid = false;
            for (var i in filters) {
                isValid = filters[i].re.test(value);
                $error.hide();
                $submit.show();
                if (!isValid) {
                    $error.show().text(filters[i].error);
                    $submit.hide();
                    break;
                }
            }
            return isValid;
        }
    
        $input.on('keyup blur', function() {
            test(this.value, Filters);
        });
    

But still, it is accepting numbers.. consider the input is aa99. its enabling button.

  • 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-11T10:29:42+00:00Added an answer on June 11, 2026 at 10:29 am

    In the demo I posted in your last question aa99 does NOT validate try it http://jsbin.com/ezatap/6/edit.

    Instead of /[a-z]/i use /^[a-z]+$/i

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

Sidebar

Related Questions

I got this code after searching around on stack overflow and it should work,
I want to pick photo from contacts . I got below code from stack
Hello there Stack Overflow, I hope you'll help me with my very first question
I've scoured the internet and have yet to find a solution. Help me Stack-Overflow-Kenobi,
here i want to solve stack overflow issue in this code. here in this
Never thought I'd say this, but I just got a stack overflow in my
This is one very common question asked again and again on stack overflow and
Thanks to some of the advice I have got previously on Stack Overflow I
With the help of a Stack Overflow user named Michael, I was able to
With some kindly help from StackOverflow, I've got Unity Framework to create my chained

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.