WebDialog broken showing HTML code

The following code will show a dialog with the actual HTML as text. What’s wrong with it ? thanks

def showSettingsDialog
  dlg = UI::WebDialog.new("Settings", false, "SettingsDlg", 500, 250, 500, 500, true);
  htmlCode = <<-HTML
	<form>
		<input id="chk1" type="checkbox" /> Option1</br>
		<input id="chk2" type="checkbox" /> Option2</br>
	</form>
  HTML
 
  dlg.set_html htmlCode
  dlg.show
end

If I add even a simple <a href=""></a> in the HTML code, it shows up as normal!

It is not a proper html document.

You need to wrap elements in either the <head> or <body> element, and always include a <!DOCTYPE> tag.

<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="msthemecompatible" content="yes">
    </head>
    <body>
        <form>
            <input id="chk1" type="checkbox" /> Option1</br>
            <input id="chk2" type="checkbox" /> Option2</br>
        </form>
    </body>
</html>
1 Like

ah ok, I thought it will work like it works in IE, since its using it. In IE directly, its showing the form.
Seems <html></html> its enough also. Thanks Dan.