Try to use [ this.id.replace("remove","") ] replace [ this.id.charAt(this.id.length-1) ] then will fix 10 new fields bug.
JS Lee () - 7 years ago - Reply 0
I think it is not working with bootstrap 4.0.0. any experience with this?
Peter Kortvel () - 7 years ago - Reply 0
How can I use this feature to add it as way to do a search to my database?
i.e the PHP query will as an example be SELECT * FROM TABLENAME WHERE Field1 = "Input1" OR Field1 = "Input2" OR Field1 = "Input3" etc....
Leon Claassen () - 8 years ago - Reply 0
a few bugs else its fine.....for a better solution visit inflatingknowledge.blogspot...
inflating knowledge blogspot () - 8 years ago - Reply 0
Does anyone know how or if it is possible to add angularJs ng-autocomplete when a new input tag is created? http://plnkr.co/edit/il2J8q...
Ka. () - 10 years ago - Reply 0
Nice one .good
Take a look at this tutorial for easy solution http://voidtricks.com/jquer...
Anand Roshan () - 10 years ago - Reply 0
To fix the issue with the delete button after 10 input boxes, replace this line "this.id.charAt(this.id.length-1);" with this line "this.id.substr(this.id.lastIndexOf("whatever the last character is before the number")+1);" in this case the last character will be "e" since the delete button id is "remove" and then the number.
The issue with this is that the charAt function is grabbing the very last character, once you have ten fields, the very last character is 0 so it will delete the first input and leave the delete button. Hope this helps anybody else who visits this later.
OsomM () - 10 years ago - Reply 0
How can I get this to work if I have more than just one field being added/removed? I have accomplished that already, I just haven't figured out the 10 problem
Edit-Nevermind, I tried 'e' like he used and it works perfectly.
Roger Hazen () - 10 years ago - Reply 1
"this.id.substr(this.id.lastIndexOf("e")+1);" this is all you have to do.
OsomM () - 10 years ago - Reply 0
latest link also had a bug when created input groups are more than 10 then the delete button removes only the btn-danger button not the input text field with it.
Indian () - 11 years ago - Reply 0
There is some bug with fields after 10 new fields was created.
On 11, 12, etc fields script doesn't work correctly.
Red block disappears, but input field still showing.
Ninja Gaiden () - 11 years ago - Reply 0
while the idea is cool it appears that clicking return will delete the top most entry if you are focused on one of the inputs. This happened in Chrome and Firefox. Is that a bug or a feature? Either way I would fix it.
Jared Toporek () - 11 years ago - Reply 0
Ok, here is a fixed version: http://bootsnipp.com/msurgu...
you can fix it by preventing the enter key event on your form :
$( "#form" ).keypress(function(e) {
if ( e.which == 13 ) {
e.preventDefault();
}
});
maxsurguy () - 11 years ago - Reply 0