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 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

We try to convert from string to Byte[] using the following Java code: String
I try Request.Form.Set(k, v) but it's throwing exception Collection is read-only
I try to build a gui (Swing) for a simple java application. The application
So i want to try a new concept that involves deep modifications of the
I'm new to the concept of nw-sniffing. < so , i'll try to describe
This is a very basic concept, but something I have never been able to
So, I am try to write a simple base Exception class for C++, based
Is there a way to test if a collection is already initialized? try-catch only?
I would like to try out a demo (more like a proof of concept),
I seem to be missing some key concept(s) when it comes to flex itemrenderers,

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.