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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T17:25:09+00:00 2026-06-12T17:25:09+00:00

I want to pass one parameter to a function called ForPaste() . My function

  • 0

I want to pass one parameter to a function called ForPaste().

My function is given below:

 var regex = /^[A-Za-z0-9ĀĒĪŌŪāēīōū\.\-\~\`\'' ]*$/;
    var SalaryRegex = /^[A-Za-z0-9\,\.\/\$ ]*$/;
        $.fn.ForPaste = function () {
            return this.each(function () {
                $(this).bind('input propertychange', function () {
                    var value = $(this).val();
                    if (!regex.test(value)) {
                        $(this).val("");
                    }
                });
            });
        };

This function is in a common JS file. It is called on individual pages. I want to test the regex depending on the parameter passed. So can I know the method about to call the ForPaste() function with the parameter.e.g $("#Text1").Forpaste('FromForm1'); and I get this FromForm1 in the ForPaste() function.

  • 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-12T17:25:11+00:00Added an answer on June 12, 2026 at 5:25 pm

    You define a formal parameter for your function.

          // formal parameter--v
    $.fn.ForPaste = function (the_value) {
    
        alert( the_value ); // displays the argument passed
    
        // rest of your code
    };
    

    Whatever value was passed to ForPaste() will be referenced by the_value. (Of course you can change the name to any valid identifier.)

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

Sidebar

Related Questions

If I have a function in SSJS and I want to pass one firm
I want to pass several parameters, one of which is optional, to a function.
I want to pass a table name as a parameter in a Postgres function.
In the parameter's of a function, I want to pass a default argument that
I want to pass the value of 'undefined' on a multiple parameter function but
I want to pass the parameter that List.sortBy takes through to another function. My
I want to pass more than one variable to other web pages. I try
If I want to pass a structure defined in windows.h to one of method
i have two flex applications and i want to pass the data from one
I'm developing an HTML5 application. I want to parse an XML like this one:

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.