Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Javascript function inside Django Loop runs only once

In my template, i generate each table row within a django for loop,
I have this function that formats strings the way I want, but it’s working only in the first row of the table, I dont know why.

enter image description here
enter image description here

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Well the problem is basically that in HTML you can’t have to elements with the same id, and you are calling them cpfpg then is logic that the first row is ok because you have only one element with that id but after that you have more than one element with the same id and that’s the problem.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading