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 8910285
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T03:39:04+00:00 2026-06-15T03:39:04+00:00

I have a form which I would like to validate certain fields as being

  • 0

I have a form which I would like to validate certain fields as being required as well as being digits. I’m having trouble figuring out how to apply both rules to said fields.

Currently here is how I am applying only the required rule, displaying the message in a span I have built into my form.

    if (jQuery.validator) {
    jQuery.validator.setDefaults({
        errorPlacement: function (error, element) {
            error.appendTo('#invalid-' + element.attr('id'));
        }
    });
}

$("#UserInputs").validate();


<label for="AvgGroupSize">Average Group Size:</label><br />
<span id="invalid-AvgGroupSize"></span>
<input type='text' id='AvgGroupSize' class='required' size='4' value='15'/> EEA's

How would I able to add a second validation rule (digits) to this field?

Thank you.

  • 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-15T03:39:05+00:00Added an answer on June 15, 2026 at 3:39 am

    You just need to add a class to your input:
    <input type='text' id='AvgGroupSize' class='required digits' size='4' value='15'/> EEA’s

    if digits validation class doesn’t exist yet you need to add i through: Add Class Rules

    Another option might be is just adding rules to your input.

    something like this:

    $("#AvgGroupSize").rules("add", {
     minlength: 2
    });
    

    Read more on how to Add rule

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

Sidebar

Related Questions

I have a form for which I would like to toggle a field's required
We have a form which uses the JQuery Validation Plugin and would like to
I have a form which includes a data sheet. I would like to make
I have a simple form that I would like to validate on form submission.
In a customised form I would have a create Purchase Menubutton which opens a
I have a form which consists of 2 steps. What I'd like to do
In simple terms I have a form which has three identical entry fields. The
Im having a master page form which i validate. I add code inside the
I have a dashboard with users details which they can edit. I would like
What I would like to do is the following. I have an image which

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.