Home > WebEOC > Admin Guide > FAQs > Avoid or Resolve JavaScript Errors?

Avoid or Resolve JavaScript Errors?

Table of contents

Error

If you routinely work with JavaScript in WebEOC, you have probably found code, copied the code, tweaked it a little, and then added it to your board. Although this may be acceptable in the majority of cases, this may result in an occasional error. Such an error is typically caused by the presence of the following operators: a < symbol or &&. The specific error you receive is likely one of the following:

Error Description:
System.Xml.XmlException: The '[' character, hexadecimal value 0x5B, cannot be included in a name. Line 30, position 54.

or

Error Description: 
System.Xml.XmlException: An error occurred while parsing EntityName. Line 30, position 43.

Solution

To correct this error, you need to replace the < symbol with &It; and you must replace the && symbol with &amp;&amp;

For example: 

if (document.forms[0].fieldname.value  <  999) { alert ("That’s too large")

should be 

if (document.forms[0].fieldname.value  &It; 999) { alert ("That’s too large") 

As another example:

if (document. forms[0].fieldname1.value==”” && document.fieldname2.value==””) { alert ("Both fields cannot be blank")

should be

if (document. forms[0].fieldname1.value==”” &amp;&amp; document.fieldname2.value==””) { alert ("Both fields cannot be blank")
You must to post a comment.
Last modified

Tags

Classifications

This page has no classifications.