Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do I get a less than in a javascript for loop in XSL to work?
    primarykey
    data
    text
    <p>I am using CDATA to escape the script but in IE8's debugger I still get this message: "Expected ')'" in the for loop conditions. I am assuming it still thinks that the ; in the <code>&amp;lt;</code> generated by CDATA is ending the loop conditions.</p> <p>Original script in my XSL template:</p> <pre><code>&lt;script type="text/javascript" language="javascript"&gt; &lt;![CDATA[ function submitform(form){ var oErrorArray = new Array(); for (i=0;i&lt;form.length;i++) eval("oErrorArray["+i+"]=oError"+i); var goForm = true; for(i=0;i&lt;form.length;i++) { oErrorArray[i].innerHTML = ""; if(form[i].value="")){ oErrorArray[i].innerHTML = "Error - input field is blank"; goForm = false; } } if(goForm == true) form.submit(); } function resetform(form){ form.reset(); } ]]&gt; &lt;/script&gt; </code></pre> <p>Code generated after transformation <em>(from IE8 debugger)</em>:</p> <pre><code>&lt;script type="text/javascript" language="javascript"&gt; function submitform(form){ var oErrorArray = new Array(); for (i=0;i&amp;lt;form.length;i++) eval("oErrorArray["+i+"]=oError"+i); goForm = true; for(i=0;i&amp;lt;form.length;i++) { oErrorArray[i].innerHTML = ""; if(form[i].value="")){ oErrorArray[i].innerHTML = "Error - input field is blank"; goForm = false; } } if(goForm == true) form.submit(); } function resetform(form){ form.reset(); } &lt;/script&gt; </code></pre> <p>Error reported by IE8 debugger: <strong>Expected ')' login.xml, line 29 character 30</strong> <em>(which is right after the first "form.length")</em></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload