Notes:
The ID/name starts on 3, so the next generated ID/name will be 4
If your browser supports it, you'll see a color picker here instead of a text field. AddRemoveTextbox supports this type, too!
In this example, a set of preexisting input fields are registered. You don't need to do anything differently to register the set: simply invoke AddRemoveTextbox on any ONE input field within the set. It doesn't matter which one you use, nor does it matter if the input fields are in chronological order in the page, nor does it matter whether the IDs have gaps in their numbering.
These fields' IDs and names remain contiguous. Compare what the code says to what your favorite DOM inspector says. This functionality is disabled by default because it can break applications. Be sure that your application can handle changing IDs and names before using this.
This is set to allow 3 fields. You won't be able to add more after that, but if you delete one of them, you'll be able to add one again.
This example defines a callback that gets triggered when a field is added, and a callback that gets triggered when a field is removed.
I hope you found the code behind these examples helpful. Please consider donating to this project to show your support. Your support is greatly appreciated, and it motivates me to keep this project alive and to release more open source software.
https://paypal.me/KurtisLoVerde/5