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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:47:32+00:00 2026-05-28T06:47:32+00:00

Currently i’m using the iMask script to help perform masking and sanity check on

  • 0

Currently i’m using the iMask script to help perform masking and sanity check on my input for interest rate. It works great when all the input are loaded at the same time on the page. However, when i use ajax call to dynamically add in new input, those input are not being monitored by the iMask script.

My loaded this input:

<input type="text" id="interestRate" size="25" class="numeric" name="interestRate" value=""/>

and loaded the iMask using the code below at the bottom:

<script type="text/javascript">
    jQuery('.numeric').iMask({
          type: 'number'             
         ,sanity : function( val ){
            if(val.length > 5){
                return val.substr(0,5);
            }else{
                return val;
            }
        }
    });

This works fine. But if i use ajax to append a new row of data, with additional input for interestRate, those new input would not be masked by the iMask.

I wonder is there anyway that i can make the ajax returned html to be ‘assigned’ with the iMask function as well.

Thanx

  • 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-28T06:47:33+00:00Added an answer on May 28, 2026 at 6:47 am

    I believe you have to call iMask function on all new elements that you insert with Ajax. Be careful not to call it for elements that you already iMasked, not sure if iMask can handle it gracefully.

    This is how I would do it:

    var alreadyIMasked = $('.numeric'); // save already iMasked elements before an ajax call
    $.ajax({
      url: '...',
      success: function( data ) {
        $(".some_list").append(data); // append your new elements to the list
        $('.numeric').not(alreadyIMasked).iMask({.....});
      }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Currently, if I want to output a SQL script for a table in my
Currently, I am developing a product that does fairly intensive calculations using MS SQL
Currently, I have: <html> <div class=yes1><span><img src=img></span></div> </html> <script> var x = ='yes1' var
Currently i'm having trouble using two functions in my -(void)viewDidLoad , both of these
Currently I am using Amazon Cloudfront to service static objects on my ASP.Net MVC3
Currently I am using a pretty basic function to pre-load images: function preload(arrayOfImages) {
Currently, I'm using && and || instead of AND and OR because that's how
Currently I'm transferring a String across the network, using DataInput/OutputStream's. The String I am
Currently I am using a Html.EditorFor control in a default 'Create' View page like
Currently, I don't really have a good method of debugging JavaScript in Internet Explorer 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.