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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T15:28:21+00:00 2026-05-25T15:28:21+00:00

why after search and click on result search and click on plus(button add input)

  • 0

why after search and click on result search and click on plus(button add input) in the example on part Adding input, Date formating($('.find_input').delegate('input.date:text', 'keyup', ....) and normal number formatting($('.find_input').delegate('input.numeric:text','keyup',...) not work.

EXAMPLE: http://www.binboy.gigfa.com/admin/tour_foreign/insert_foreign

Js full code: http://jsfiddle.net/ZpDDR/

...
///// Date formating /////////////////////////////////////////////////////////////////////////////////////////
    $dateSet = 0;
    $monthSet = 0;
    $yearSet = 0;

    $('.find_input').delegate('input.date:text', 'keyup', function () {
        $val = $(this).val().replace(/[^\d]+/g, "").match(/\d{1,12}$/);
        if($val == null) {
            return;
        } else {
            $val = $val.join("");
        }

        if($(this).val().match(/\d{4,}$/) && $val.length%2 == 0) {
            $val = $val.match(/\d{2}/g);
            if($yearSet < $monthSet) {
                if($val.length == 4) {
                    $(this).val($val.join("").replace(/(\d{2})(\d{2})(\d{4})$/,'$3/$1/$2'));
                    $yearSet++;
                } else if($val.length == 6){

                    $(this).val($val.join("").replace(/(\d{4})(\d{2})(\d{2})(\d{4})$/,'$4/$2/$3'));
                    $yearSet++;
                }
            } else {
                if($monthSet < $dateSet) {
                    $(this).val($val.join("").replace(/(\d{4})(\d{2})(\d{2})(\d{2})$/,'$1/$4/$3'));
                    $monthSet++;
                } else {

                    if($val.length == 2) {
                           $(this).val($val.reverse().join("/"));
                        $dateSet++;
                        $monthSet++;
                    } else {
                           $(this).val($val.join("").replace(/(\d{4})(\d{2})(\d{2})(\d{2})$/,'$1/$2/$4'));
                        $dateSet++;
                    }
                }
            }
        }
    });

///normal number formatting/////////////////////////////////////////////////////////////////////////////////////////    
    $('.find_input').delegate('input.numeric:text','keyup',function () {
        $val = $(this).val().match(/[0-9]/g).reverse().join("").match(/[0-9]{1,3}/g).join(",").match(/./g).reverse().join("");
        $(this).val($val)
    });
  • 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-25T15:28:21+00:00Added an answer on May 25, 2026 at 3:28 pm

    The problem is that the element that you’re delegating from,.find_input, doesn’t exist yet when you’re setting up the delegation function. delegate allows for defining event handlers for elements that aren’t created yet, but only elements that match the second selector E.g., $('#must-exist-now').delegate('.can-be-created-later', ...);

    I’m not sure if I described that well, but the solution is to change your statement to delegate from something that already exists on DOM load. For example: $(document).delegate('input.date:text', ...).

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

Sidebar

Related Questions

After search and click on result search and click on plus(button add input) next
In following code $('body').delegate('.submit',... passed = search && passed; ... after click on button
The work flow: user click the button, a dialog box opens with a search
why my code have this error, after click on button submit and click on
I have a VF page which has 2 date fields and search button. On
After having a search around I could not find exactly what I want, I
so here's the problem I have one form, it outputs search results after submit,
After lots of attempts and search I have never found a satisfactory way to
After doing a long search on stackoverflow i didn't find any one talked about
After doing a light search on the Lazarus site I've come to the conclusion

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.