How to set doctype on Notes forms

When redesigning my website to use Bootstrap, I ran into a problem. The navbar (meny) did not render correctly in Internet Explorer 9, despite looking perfect in Firefox and Internet Explorer 10. There are several discussions about this problem on StackOverflow and other forums, and the solution is simply to add <!DOCTYPE HTML> on the first line of the HTML code.

However, IBM Domino automatically adds a different doctype string, and there is no database or form property to change/set the correct value. But there is actually a way, and it is not very complicated.

Simply create a computed for display field called $$HTMLFrontMatter. Make it hidden from web browsers, and in it you enter a formula that will give you the desired doctype. I simply put “<!DOCTYPE HTML>” in there, and it worked perfectly. Also make sure “Use Javascript when generating pages” is turned off.

This way to modify the HTML generated is documented in the online help. It was added in Domino 8.

This Post Has 2 Comments

Leave a Reply