<FORM> tags are not supported in the HTML specified in either the Content property or the Content Link property

sharepoint.stackexchange https://sharepoint.stackexchange.com/questions/226435

  •  01-01-2021
  •  | 
  •  

Pregunta

I've got two SharePoint Online site collections. One is rather old, the other one was created about two hours ago.

There is an HTML file located in _catalogs/master/webparts/test.html with the following contents. Notice that there is no tag.

<h1>TEST</h1> 

Now that I add a CEWP to a page and reference this simple HTML file the webpart displays an error:

< FORM > tags are not supported in the HTML specified in either the Content property or the Content Link property. You can remove the < FORM > tag, or use the Page Viewer Web Part, which supports the HTML < FORM > tag. More about the Page Viewer Web Part

I have the same problem in two site collections no matter what HTML I use. At the same time, on other two site collections, there is no such problem.

More info. If I move this html file from _catalogs/master/.. to Assets library then CEWP displays it quite fine. But I've been using _catalogs folder for HTML files for over a year with no problems, and I don't understand why all over sudden it's happening on several site collections. The old site collections with the same approach are still working just fine...

Did anyone encounter this weird bug? Any ideas how to fix it?

¿Fue útil?

Solución

I've discovered the reason. And it's quite ridiculuous. If there is a space immediately after slash in the URL to the HTML it causes CEWP to show this error. Examples:

Good URL:

/sites/modernDev2/_catalogs/.../sptest/webparts/test.html

Gives a misleading < form > tag ERROR:

/sites/modernDev2/_catalogs/.../sptest/ webparts/test.html

< FORM > tags are not supported in the HTML specified in either the Content property or the Content Link property. You can remove the < FORM > tag, or use the Page Viewer Web Part, which supports the HTML < FORM > tag. More about the Page Viewer Web Part

Notice the space right after /sptest/ That was the reason.

Licenciado bajo: CC-BY-SA con atribución
scroll top