2
To using an ajax request, to send a number to the server and return information relating to that number! In case I return two values, they are nome & funcao
.
So far so good! It’s working as it should! It sends the information and returns its respective values!
On that same page I use a append
to add a new set of input’s, they have the same classes, they are matricula / nome / funcao
.
Then my problem arises! By inserting the number in the first class input matricula
, it returns the values, but when using the append
and insert another number into the next class input matricula
, it does not return the information it should return, it simply reuses the result of the matricula
previous and reinsere in input’s nome & funcao
.
I’m 90% sure that this problem is being caused by jquery, because I don’t know much, and I’m cluttering things up! So could you help me?
In short I would like the code to do the following
That every
input class="matricula"
, auto fills up their respective input’s, ie theinput class="funcao"
&&input class="nome"
.Remember that in the code I make each
append
, the input’s are inserted within adiv class="trabalhador"
.
The working example is here :: http://www.vullsper.com/consultaajax/
The codes are here:: http://jsfiddle.net/n7vbg3g2/
At first it didn’t work, but the code you did helped a lot to build a new code!
– ivan veloso