I want to allow users to dynamically create as many input fields as they want within the format that I supply to them. I need the features below:
- There should be a button to add more fields
- There should be a button next to each field to delete the field
Is there any method which satisfies my needs?
I've already used the append()
method in JavaScript but I was not able to delete the fields using a button next to it.
onclick on a button:
$( '#some_div' ).append( '<input type="text" name="tel[]" class="form-control">' );
I've heard something about grids
but could not find anything relevant.