I'm trying to dynamically add and remove phone number fields, while providing validation/masking on them at the same time. I have two examples that each do part of this, but I'm struggling to get them to work together. To start:
- This example works for the phone validation. The problem is the remove button only removes the most-recent row added. I need to have a remove button next to each input field and be able to remove each one independently.
- This doesn't have the masking/validation, but it does the add/remove just as needed. The issue is my first example is using .append to create much of what's going on (and adding the .mask to each input field), where the second example is using .clone.
I'd like to integrate the masking into the second example, but have been struggling to do so.
Any help would be greatly appreciated.