0

Using ng-repeat I'm displaying Item related textboxes and on click of SaveAll button I want to read all text box values based on ITEM ID and Save it to DB.

<tr>
  <td>
     <table ng-repeat="item in itemDtls">
        <tr>
            <td>
                <label for="lblItemName">Item ID: </label> {{item.ITEM_ID}} 
             </td>
        </tr>
        <tr>
             <td>
                <label for="lblPriority">Item Priority </label>
                <input type="text" id="inpPriority" ng-model="ValuesPriority" value="{{item.PRIORITY}}" />
              </td>
        </tr>
         <tr>
            <td>
               <label for="lblComment">Comment</label>
                <input type="text" id="inpComment" ng-model="ValuesComment" value="{{item.COMMENT}}" />
             </td>
          </tr>
      <tr>
  </table>
</td>

    <tr>
      <td>
         <button type="submit" ng-click="SaveAll()">SaveAll</button>
      </td>
   </tr>
3
  • what you've tried to store into db in the backend? Commented Jul 1, 2019 at 9:21
  • want to save all item details after modification of each item. Commented Jul 1, 2019 at 9:24
  • it requires backend code. i think it is not possible in javascript Commented Jul 1, 2019 at 9:27

1 Answer 1

1

Do not use "value" tag instead use "ng-model" only. Eg:

            <td>
           <label for="lblComment">Comment</label>
            <input type="text" id="inpComment" ng-model="item.COMMENT" />
         </td>
  • So whatever comments you change, it will update in that variable.
  • Later you can send "itemDtls" in backend to store in DB.
  • You must need a backend to store in DB.
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.