I am currently trying to create a CHM help file where a user can enter values which will then generate a button to send the lPARAM to the WM_TCARD.
Currently, I have tested in IE 11, 10, 9 & 8, according to the DOM Explorer the object is being created with the correct parameters but it is not displaying correctly and not appearing as a button.
<body>
<button onclick="create_object();">Try it</button>
<input type="text" id="layout_enter" />
<button id=click_button99 onclick="click_new_object();">click</button>
<script>
function create_object() {
var new_obj = document.createElement("OBJECT");
new_obj.setAttribute("classid", "clsid:41B23C28-488E-4E5C-ACE2-BB0BBABE99E8");
new_obj.setAttribute("codebase", "HHCTRL.ocx#Version=4,72,8252,0");
new_obj.setAttribute("type", "application/x-oleobject");
new_obj.setAttribute("id", "object99");
document.body.appendChild(new_obj);
var layout_entered = "10," +
document.getElementById('layout_enter').value
var z = document.createElement("PARAM");
z.setAttribute("name", "Button");
z.setAttribute("value", "PP Sonic");
document.getElementById("object99").appendChild(z);
var y = document.createElement("PARAM");
y.setAttribute("name", "Command");
y.setAttribute("value", "TCard");
document.getElementById("object99").appendChild(y);
var x = document.createElement("PARAM");
x.setAttribute("name", "Image");
x.setAttribute("value", " ");
document.getElementById("object99").appendChild(x);
var w = document.createElement("PARAM");
w.setAttribute("name", "Item1");
w.setAttribute("value", layout_entered);
document.getElementById("object99").appendChild(w);
var v = document.createElement("PARAM");
v.setAttribute("name", "UseButton");
v.setAttribute("value", "TRUE");
document.getElementById("object99").appendChild(v);
var u = document.createElement("PARAM");
u.setAttribute("name", "UseIcon");
u.setAttribute("value", "TRUE");
document.getElementById("object99").appendChild(u);
}
function click_new_object() {
document.getElementById("object99").click();
}
</script>
</body>
Any help/advice will be appreciated. I have already looked at the security options in Internet Options for ActiveX which did not resolve anything. If I was to have the object present in the code already then it appears. Making me think it's not an issue with the object but the creation.
Please note: I cannot use JQuery.
Thank you.