0

I have a form written in html on a page and there is a button above the form. Now i want to know the functionality i can add to the button so that when i press the button, it will directly add the same form i have on the page already just beneath it so i can make multiple submissions.

//form

<button>Add Form</button>
<form>
  <div class="row">
    <div class="col-sm-6">
      <div class="form-group">
        <label for="title">Title</label>
        <input type="text" class="form-control" id="title" name="title" placeholder="Title">
      </div>
   </div>
</form>
2
  • Can you be a bit more specific about the problem. Commented Feb 10, 2017 at 13:28
  • When i click on the add form button, it should drop down the same form which i already have on the page, just beneath the initial form so i can make multiple submission Commented Feb 10, 2017 at 13:30

1 Answer 1

1
<button (click)=" Add some value to forms array  ">Add Form</button>
<div *ngFor="let form of forms">
    <form>
        <!-- Your Form -->
    </form>
</div>
Sign up to request clarification or add additional context in comments.

3 Comments

above is not code ... just path to your problem ... you should implement it with code
so i have to create a loop for the form basically?
an explanation with the code usually helps the question asker understand better

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.