Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 3 of 3
  1. #1
    Senior Member
    Join Date
    Feb 2011
    Posts
    101
    Member #
    26966
    so what I would like to have happen is I have textboxes that will be dynamically created using name/id of name[] for an array. then for each new textbox that has a value, those values will show up as the values for a dropdown list called "list", I want this to happen dynamically please. any help is appreciated!

  2.  

  3. #2
    Unpaid WDF Intern TheGAME1264's Avatar
    Join Date
    Dec 2002
    Location
    Not from USA
    Posts
    14,485
    Member #
    425
    Liked
    2783 times
    I don't really understand what you're trying to accomplish here.

    Are you saying that you've got a series of textboxes that you're going to populate with values from the name array, and for each of those textboxes you want a dropdown list populated?

    I'd do this personally (assuming I understand this right) using jQuery. Something like this:
    Code:
    var textboxes = $"(input");
    var selectOptions = $("option");
    textboxes.change(function() {
    textboxes.each(function () {
         var textboxVal = $(this).val();
         // check to see if the option is listed...if not, add it.
    });
    selectOptions.each(function() {
       var optionVal = $(this).attr("value");
      // check to see if the option is in one of the textboxes...if not, remove it.
    });
    });
    You're not going to find a cut-and-dried answer to this one just because it's a bit too specific of a situation.
    If I've helped you out in any way, please pay it forward. My wife and I are walking for Autism Speaks. Please donate, and thanks.

    If someone helped you out, be sure to "Like" their post and/or help them in kind. The "Like" link is on the bottom right of each post, beside the "Share" link.

    My stuff (well, some of it): My bowling alley site | Canadian Postal Code Info (beta)

  4. #3
    Senior Member
    Join Date
    Feb 2011
    Posts
    101
    Member #
    26966
    no, what I am trying to accomplish is I have lets say four textboxes that will be dynamically created using the name of "name[]". foreach of those textboxes, they become one value in a drop down list....so I have lets say four textboxes with the names "name[]", then those four values will be the population of that drop down. so the drop down would have options of "1st name[]", "2nd name[]", "3rd name[]", "4th name[]". does this maybe make some more sense?


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 05:05 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com