Hi Everyone,

I created a script where rows gets cloned, then I created a script to check if a specific code exists in the database. This all works fine. My problem is my status message when a code exist, it shows on the first row but not the rest. I made the id of #status unique but I can't understand why it's not showing in the dynamically created row.

Can someone please tell me what I'm doing wrong, or just lead me in the right direction?

I added my code to Jsfiddle

Re: Check value of cloned row 80 80

Not sure about the [] character in your id and name values, is that causing them to fail to be found? I always stick with the basic rule for ids, which I think is:

Re: Check value of cloned row 80 80

On line 11 you have:

$('.codeForm tr:last div[id="status"]').attr('id', '#status' + counter + '');

which ends up generating <div id="#status">...</div>. Get rid of the hash symbol. You need the hash symbol only when using selector expressions for jquery, not for the actual ids of the elements. It should be:

$('.codeForm tr:last div[id="status"]').attr('id', 'status' + counter );
Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.