I am having difficulties setting up URL values within a list Multiline Rich Text field. The code I am using is as follows:

      ThisList = "TK0001 TK0002 TK0003 TK0004"
      TaskArray = ThisList.split(" ");
      var AssocHTML = '';
      for (i = 0; i < TaskArray.length; i++) { 
              AssocHTML = AssocHTML + '<a href="https://oursites<snip>/Lists/TestList/DispForm.aspx?ID='+TaskArray[i].substr(j+2) + '&RootFolder=%2A">'+TaskArray[i]+'</a> ';
      $('nobr:contains("Task List")').closest('tr').find('div.ms-rtestate-write').html(AssocHTML); 


If I run this code using IE, the field is populated correctly

"<a href="https://oursites<snip>/Lists/TestList/DispForm.aspx?ID=0001&RootFolder=%2A">TK0001</a> <a href="https://oursites<snip>/Lists/TestList/DispForm.aspx?ID=0002&RootFolder=%2A">TK0002</a> <a href="https://oursites<snip>/Lists/TestList/DispForm.aspx?ID=0003&RootFolder=%2A">TK0003</a> <a href="https://oursites<snip>/Lists/TestList/DispForm.aspx?ID=0004&RootFolder=%2A">TK0004</a>"

However, if I run this same code under EDGE, the following value is populated into that field

"<a href="/Lists/TestList/DispForm.aspx?ID=0001&RootFolder=%2A">TK0001</a> <a href="/Lists/TestList/DispForm.aspx?ID=0002&RootFolder=%2A">TK0002</a> <a href="/Lists/TestList/DispForm.aspx?ID=0003&RootFolder=%2A">TK0003</a> <a>TK0004</a>"

The URL is modified (fair enough) but the last value is always corrupted.

How do I stop EDGE applying field edits, or is there some encoding that I need to apply to the AssocHTML value to stop EDGE reevaluating the value?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.