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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T19:11:10+00:00 2026-05-22T19:11:10+00:00

To try the concept, I’m doing a very simple test. I got a form

  • 0

To try the concept, I’m doing a very simple test.

I got a form with some text input showing up from the start.
When I click on a field, I want to capture its Id, and add a value to the input text.

$(document).ready(function() {
    $('input').focus(function() {
        var currentId = $(this).attr('id');
       $("#"+currentId).val('blah');
    });
});

This works great with the initial fields, but it stops working with the fields added using ajax calls.

The trick is, users are able to click on any field and I don’t know which until they click.
My Ids looks like this:

experience0-CompanyName //(original one)
experience[n]-CompanyName

(the [n] part is also used to order the fields in the form as elements are grouped by experience, education skills etc…

how can I achieve 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-22T19:11:10+00:00Added an answer on May 22, 2026 at 7:11 pm

    A simple change:

    $(document).ready(function() {
        $('input').live("focus", function() {
            var currentId = $(this).attr('id');
           $("#"+currentId).val('blah');
        });
    });
    

    .focus only binds to elements that exist at the time it’s called. .live() binds a function to an event for all existing elements, and any that are added to the DOM later.

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

Sidebar

Related Questions

I'm running some test to prove a concept and i just wrote this code
i'm trying to run some test cases, but when I try to store one
I just try to understand the concept of the ItemsPanelTemplate. For this i built
This is a very basic concept, but something I have never been able to
I didn't fully understand the concept of threads I have some questions. Assume we
I am trying to produce a proof of concept shipping logging from Log4J through
I'm new to the concept of nw-sniffing. < so , i'll try to describe
I decided to try out JavaScript genius John Resig's simple JavaScript inheritance as detailed
Background We're doing a proof-of-concept around Sharepoint 2007. It's installed using VMWare on Windows
I looking into the concept of queueing for web apps (i.e. putting some types

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.