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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T10:55:58+00:00 2026-06-13T10:55:58+00:00

I have a textbox <input name=tx1 size=10 type=text id=tx1 class=sample dynamic format maxlength=10 />

  • 0

I have a textbox

<input name="tx1" size="10" type="text" id="tx1" class="sample dynamic format" maxlength="10" />

Textbox change and keyup events are bind to two different functions.

$('.sample.dynamic').change(myJsFunction);


$('.format').keyup(function (e) {
        formatfn(this, e);

    });

This is my formatfn:

function formatfn(sValue, e) {

//Do some formatting

$(sValue).val(newVal);

return newVal;

}

Both events working fine in IE and firefox but in chrome only keyup function is working and change event is not fired.

if i comment the below line in formatfn then change event start firing in chrome as well.

//$(sValue).val(newVal);

But i can not comment this line as i need to apply the formatting on every keypress.

I have looked two similar questions here and here but couldn’t find the answer.

Update : Formatfn is doing various formatting stuff, but just to give you idea about newval variable i am adding some related code here:

var newVal = $(sValue).val();

if (newVal != "")
        newVal = parseInt(RemoveCommas(newVal), 10).toString();

    var sRegExp = new RegExp('(-?[0-9]+)([0-9]{3})');

    while (sRegExp.test(newVal)) {
        newVal = newVal.replace(sRegExp, '$1,$2');
  • 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-13T10:55:59+00:00Added an answer on June 13, 2026 at 10:55 am

    You could always roll your own change function by using blur:

    $('.sample.dynamic').data('last','').on('blur', function() {
        var last = $(this).data('last');
        if (this.value!=''&&this.value!=last) myJsFunction();
        $(this).data('last', this.value);
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have multiple textbox with same name, example : <input type = text name
i have login page with 2 textbox and 1 button <input name=txtUserName type=text value=666
I have a one textbox. It name is example. <input type=text name=example/> I want
I have a textbox; <input runat=server type=hidden value=0 id=input1 name=input1_name> I have a div;
I have a textbox with default text like Enter Name Once user starts typing
I have a hidden field <input type = 'hidden' name = test1 id =
I have a textbox where I am taking input as full name. When user
I have several textareas like: <asp:textbox class=input ThisIsRussia ..... /> <asp:textbox class=input ..... />
How to rewrite Webconfig connection string at runtime.I have input textbox for Server,UserName and
I'm trying to use a RegularExpressionValidator to validate a TextBox input length. I have

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.