WebDialog broken showing HTML code


#1

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!


#3

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>

#4

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.