1
I got a little problem.
I need to know which id of input type='text'
the user is typing, and the inputs are generated dynamically. With each new input, a new id is generated with a counter progressively increasing how much the user needs.
For example... by default there is only one field, and when it presses the button of "+"
A new field appears with ids "txtOutrosNomes1", "txtOutrosNomes2" and so on
How to get the name of this id that was typed by the user?
EDITION 1
var divResponsible = $(document.createElement('div')).attr("id", 'respDiv' + contarEmails);
divResponsible.after().html("<div id='contentEmails'><div class='row'> <div class='col-lg-12'><div class='col-lg-3'></div> <div class='col-xs-4 col-lg-4 col-md-4 col-sm-4'><div class='form-group has-feedback' id='divOutrosNomes"+contarEmails+"'>Nome<input type='text' onclick='pegaValues()' class='form-control' name='txtOutrosNomes["+ contarEmails +"]' id='txtOutrosNomes"+ contarEmails +"' placeholder='Fulano da Silva' autocomplete='off' automplete='off'></div></div><div class='col-xs-4 col-lg-4 col-md-4 col-sm-4'> <div class='form-group has-feedback' id='divOutrosEmails" + contarEmails+ "'>E-mail<input type='text' class='form-control' name='txtOutrosEmails[" + contarEmails + "]' id='txtOutrosEmails"+contarEmails+"' placeholder='[email protected]' autocomplete='off' automplete='off'></div><div class='col-lg-1'></div> </div></div> </div></div><div class='msgDados"+contarEmails+"'></div><div class='conteudo-select-partner"+contarEmails+"' style='display: none;'></div> </div>");
divResponsible.appendTo("#groupEmails");
contarEmails++;
I generate my textbox code as well... as I would add the bootstrap classes in your solution?
You have here the example of this code?
– novic
of what dynamically generates?
– gabrielfalieri
That ... because I even have a minimal example, but, I wanted to put for you very close to what you need
– novic