Link to home
Start Free TrialLog in
Avatar of Seven price
Seven priceFlag for United States of America

asked on

push array to select

http://jsfiddle.net/sevensnake/7n8NR/486/

trying to type into multiply text boxes and push the value to a select box. for some reason the array does not work.
Avatar of Julian Hansen
Julian Hansen
Flag of South Africa image

The fiddle has the addItem commented out - uncommenting it gives some errors due to some closing bracket issues.

Fixing that so it looks like this (see below) yields a result but not sure what I am looking for?
function ($scope) {

    // Item List Arrays
    $scope.items = [];
  
    $scope.addItem = function () {
       $scope.items.push({
            itemtext: $scope.item,
            
      });
    
    // cannot get this to work.
     //   $scope.array.forEach(function (items) {
   // $scope.array.push({'item'});
};

Open in new window

Avatar of Seven price

ASKER

http://jsfiddle.net/sevensnake/nvrwjd29/#base

well I want it to work without the button.   A user will type some text in the textbox. each text box will add what the user type in into a select dropdown.
The trigger for this would be ?

You have two text boxes - what condition would signal the user is finished and the data should be added to the drop down?
the bigger picture there is no need the user will move on to another text box that is not associated. More in likely when the user is finished typeing in the textbox that will lead to being done.
ASKER CERTIFIED SOLUTION
Avatar of Julian Hansen
Julian Hansen
Flag of South Africa image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Ok I made some changes. so I found a better way. but the question made me think.

Thanks.
tk
You are welcome.