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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T21:22:14+00:00 2026-05-22T21:22:14+00:00

The problem statement is like this: I have a contract. On renewal on every

  • 0

The problem statement is like this: I have a contract. On renewal on every month the contract name should append with renewal identifier. For example at beginning the name is myContract then on first renewal name should be myContract-R1, next renewal name should be myContract-R2 and so on.. On each renewal, the name should automatically change. So in Jquery how can I do this?

  • 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-22T21:22:15+00:00Added an answer on May 22, 2026 at 9:22 pm

    This is a JavaScript question, not a jQuery question. jQuery adds little to JavaScript’s built-in string manipulation.

    It sounds like you want to take a string in the form “myContract” or “myContract-Rx” and have a function that appends “-R1” (if there’s no “-Rx” already) or increments the number that’s there.

    There’s no shortcut for that, you have to do it. Here’s a sketch that works, I expect it could be optimized:

    function incrementContract(name) {
      var match = /^(.*)-R([0-9]+)$/.exec(name);
      if (match) {
        // Increment previous revision number
        name = match[1] + "-R" + (parseInt(match[2], 10) + 1);
      }
      else {
        // No previous revision number
        name += "-R1";
      }
      return name;
    }
    

    Live copy

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

Sidebar

Related Questions

I have the problem with a prepared statement like this: select ... from ...
I have problems running a dynamic LIKE statement in my project: this query works
I have a problem statement like: How to find the middle node of a
I would like to have an UPDATE statement like this: SELECT * FROM Employee
I would like to know the SQL statement to cover the following problem.I have
I have this method with a huge switch statement like this: public bool ExecuteCommand(string
I have a method that has many many statements like this: employee.LastName = file.EMPLOYEE.NAME.SUBNAME.FAMILYNAME.NAMEPART1.Value;
I have an index problem with my order by statement. I have this query
I have this simple if statement that check UItextfields if empty or not like
Here is the problem statement: Calling a setter on the object should result in

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.