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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T07:29:02+00:00 2026-05-27T07:29:02+00:00

im having a problem with dynamic forms. I have dynamically created forms on button

  • 0

im having a problem with dynamic forms.
I have dynamically created forms on button “add”. forms have ids like “editForm_1”.
for example, i have an input “Education_1” and the select box that will be filled on input click and options will be based on input value. having like 5 of those input fields and selects.
the thing is that how can i manage all those events? cause i dont think .each input is a good solution.
thanks
UPD:

$("#education").delegate("input", "keypress", function(){
if($(this).val().length>1){
    var selector = $(this).next();
    selector.empty() ;                             
    var words = $(this).val();
    $.postJSON("2.php", words, function(data){
        var tmp = data; 
        $.each(tmp, function(i, val){
            var s=selector;
            s.options[s.options.length]= new Option(val.type, val.type);
        });
    });
}

});

But im getting “s.options is undefined” ERROR

got it, used
s.append( new Option(val.type, val.type));
instead and it works

  • 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-27T07:29:02+00:00Added an answer on May 27, 2026 at 7:29 am

    Instead of attaching events using their ID’s, group the inputs into classes, then attache the event handler(s) using .delegate or .on for these classes.

    e.g

    <input id="Education_1" class="education" /> 
    <input id="Education_2" class="education" />
    

    The js

    $(document).delegate('.education','click', function(){
    
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having problem when running my Windows Forms program. In the program, I have
We are having problem with the server migration. We have one application that are
I'm having problem selecting an element with an id like this <li =0f:Bactidol_Recorder.mp4>. I
I'm having a problem using nested partials with dynamic form builder code (from the
I am writing a dynamic web page. The specific problem I am having is
Hi I'm having some problem with 2D dynamic array. int main() { double **M;
I am using reflection along with linq.Dynamic, and I am having a small problem
Im having this weird problem with creating Json dynamically.... for some reason this doesnt
I'm having a problem generating dynamic links to items from my code. Code that
I have a dynamic list of referrers, example ANN, BOB, ..., ZED. I want

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.