Error when using jQuery().html() several times
-
Hi,
I have a form in which at the end I have an “HTML Content” field with the following code:
<ul> <span id="span-1"/> <span id="span-2"/> <span id="span-3"/> <span id="span-4"/> <span id="span-5"/> </ul>Just before that HTML field, I have some “Calculated Fields” with this code (all are very similar):
(function(){ let result; if(fieldname4 === 'Mensual') result = (fieldname2 + 12 * fieldname5 * fieldname3); if(fieldname4 === 'Anual') result = (fieldname2 + fieldname5 * fieldname3); let html_str = "<li><b>some random HTML text</b></li>"; jQuery('#span-1').html(html_str); return result; })();But when I press the “Submit” button, it only shows up the first “#span-1” content, I can’t have the following “#span-X” content showing. If I comment the “#span-1” jQuery line, then the “#span-2” content is showing up.
Do you have any idea of what could be the problem? I’ve already searched in the other posts, but I didn’t find any solution. Thanks!
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘Error when using jQuery().html() several times’ is closed to new replies.