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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T18:53:32+00:00 2026-05-23T18:53:32+00:00

last.fm has this nifty feature when you’re adding an event. you have the Artists

  • 0

last.fm has this nifty feature when you’re adding an event. you have the Artists field, and when you start typing in it, another text field appears beneath it. when you start typing in that next field, another new field appears beneath and so on. I’ve been trying to figure out how to mimic this functionality using jquery but I can make it work on the first, stationary, field only. any ideas?

edit:

actually, nope, it’s not working even for the stationary one, since it adds the field on EVERY key press

edit2:

alrighty, so some fine folks have already solved my adding issue, now, how would one go about adding the field only after the first time a key is pressed.

  • 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-23T18:53:33+00:00Added an answer on May 23, 2026 at 6:53 pm

    You are probably only binding your handler to the first static input, and not the dynamically created ones. Use .live() to do your event binding. That will bind the event to future elements that match the selector.

    To make sure you only add one new one, make sure you only add it when typing into the last textbox. Check $(this).closest(".container").next(".container").length to make sure there isn’t already a new textbox.

    $("input.myClass").live("keyup", function (e) {
        var $container = $(this).closest(".container");
        if (this.value && !$container.next(".container").length) {
            var $newContainer $("<div>").insertAfter($container).addClass("container");
            ...
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This has inexplicably started happening within the last 6 months or so. This same
I'm sure this has been answered before, but I've spent the last three hours
By some coincidence this problem has come up twice in the last week. A
This one has made me a lot of stress over the last couple of
I have a ul list of 8 li's on the last li it has
I have a file called file.txt and it has this structure: owner_name : first_last_name
I have this page, let's call it index.php index.php has a list of users
I have some code where the timer EventHandler has this void timer_Tick(object sender, EventArgs
For the last 2 hours I have been fighting with this problem and trying
I'm having trouble with PHP text parsing I have a txt file which has

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.