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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:40:00+00:00 2026-05-25T12:40:00+00:00

Im using the bassistance form validation. I have a couple of fields that require

  • 0

Im using the bassistance form validation. I have a couple of fields that require digits only, but that excludes symbols like $,(,),-,*, etc from being allowed and i need these for fields like prices and phone numbers. Anyone know a method or plugin or something to work around this?

UPDATE

Basically, i need a function that says “no text allowed” and allowed symbols and numbers.

Another update

Found a function that doesnt allow text alone. But if there are symbols, it allows text as well. Any way to restrict any text?

jQuery.validator.addMethod(
  "symbols",
  function(value,element){
    var hNum=/[^a-z\s-]/;
    var inp=jQuery.trim(element.value).toLowerCase();
    if(hNum.test(inp)) {    return true;
    }
    else return false;
    },
    "Number and symbols are only allowed."
  );
  • 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-25T12:40:00+00:00Added an answer on May 25, 2026 at 12:40 pm

    According to their documentation, there’s already validation methods that can perform validation for: decimal numbers, digits and phone numbers

    **EDIT: In that case it sounds like you want to create a custom validation. There is a method called addMethod which adds a custom validation with a call-back function like the one daGrevis created.

    Example:

    jQuery.validator.addMethod("isdigit", function(value, element) {
            return /[\d()-.\$]/.test(value); 
        }, "Numbers and symbols only allowed"
    );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a form with a couple of buttons and I'm using jQuery Validation
i'm using this plug in to validate a form http://bassistance.de/jquery-plugins/jquery-plugin-validation/ I've got 3 fields,
Using ASP.NET MVC there are situations (such as form submission) that may require a
I am using the jquery validation plugin (bassistance.de/jquery-plugins/jquery-plugin-validation/id) for a bit of client-side form
I have this registration form which is then validated using "bassistance's" validate.js: $('#pForm').validate({ rules:
I have a form with multiple fields that I'm validating (some with methods added
I am using the http://bassistance.de/jquery-plugins/jquery-plugin-validation/ plug in with the follow pseudo block that I
I have been using jquery validate plugin http://bassistance.de/jquery-plugins/jquery-plugin-validation/ . It has been working successfully,
I am using jQuery Validation plugin ( http://bassistance.de/jquery-plugins/jquery-plugin-validation/ ) I have a very odd
I'm using a great jQuery contact form validator from bassistance (http://bassistance.de/jquery-plugins/jquery-plugin-validation/) is exactly what

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.