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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:03:32+00:00 2026-05-23T09:03:32+00:00

I have an input that I want to set the max value to 255.

  • 0

I have an input that I want to set the max value to 255. I’m not submitting the form, but rather calling a function which submits the data via ajax.

Some of the other validate checks are working, like required and digits, but max isn’t working. I’m using jQuery 1.4.4 and validate 1.7.

HTML

<input type="text" maxlength="3" style=" width: 190px" value="" name="Repeats" id="formfield_Repeats">

JavaScript

$(document).ready(function () {
   $("#my_form").validate({
      rules: {
         formfield_Repeats: {
            digits: true,
            required: true,
            max: 255
         }
      }
   });
});

When I go to save the app I call the valid() method on the form.

Is it a version mismatch with jQuery and the validate plugin? I could upgrade both, but the project is HUGE and I don’t necessarily want to have to retest the entire app.

  • 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-05-23T09:03:33+00:00Added an answer on May 23, 2026 at 9:03 am

    jquery validate uses the NAMES of inputs, not the id’s so you should have:

    $(document).ready(function () {
       $("#my_form").validate({
          rules: {
             Repeats: {
                digits: true,
                required: true,
                max: 255
             }
          }
       });
    });
    

    EDIT:
    hmm, ok, let’s try adding the rule directly to the input field:

    $("#my_form").validate();
    
    $('#formfield_Repeats').rules('add', {
        required: true,
        digits: true,
        max: 255
    });
    

    EDIT:
    have a look at this js fiddle: it shows this working exactly as expected with validate 1.7 and jquery 1.4.4
    http://jsfiddle.net/Et9vM/

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

Sidebar

Related Questions

I have this select input in my form that I want to access via
I have an input box that takes values from 0-100. I want to prevent
i have an input field which will be displayed. i want that to hide
I have a paragraph of text below that I want to use an input
I have an input that holds a date value like so 03/15/2012 I am
I have an input field that is by default set to type=text so that
I have 2 input boxes that are not disabled. When either gets focus no
I have set of value in float (always less than 0). Which I want
I'm fairly new to PHP, but have managed to set up a script that
I would like to have a function that takes an array as input and

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.