I'm trying to generate HTML pages in an HTA application using VBScript as the language.
I can't seem to set the element name attribute. This code all works except for the code that sets the name. I output the frmMenu.InnerHTML at the end.
set selectApp = document.createElement("select")
selectApp.ID = "selApplication"
selectApp.name = "selApplication"
frmMenu.appendChild(selectApp)
Set selectApp.onchange = GetRef("Application_Change_Event")
I have used selectApp.Name = "selApplication" and that did not work either.
Here is the whole Sub()
GetRef("CycleMappingPage")
CycleMappingPage()
Sub CycleMappingPage()
Set label1 = document.createElement("label")
label1.innerHTML = "Application: "
frmMenu.appendChild(label1)
set selectApp = document.createElement("select")
selectApp.ID = "selApplication"
selectApp.name = "selApplication"
frmMenu.appendChild(selectApp)
Set selectApp.onchange = GetRef("Application_Change_Event")
Set br1= document.createElement("br")
frmMenu.appendChild(br1)
Set br2 = document.createElement("br")
frmMenu.appendChild(br2)
Set label2 = document.createElement("label")
label2.innerHTML = "Cycle: "
frmMenu.appendChild(label2)
Set selectCycle = document.createElement("select")
selectCycle.setAttribute "name", "selCycle"
frmMenu.appendChild(selectCycle)
Set br3= document.createElement("br")
frmMenu.appendChild(br3)
Set br4 = document.createElement("br")
frmMenu.appendChild(br4)
Set inputButtonGenMap = document.createElement("input")
inputButtonGenMap.setAttribute "type", "button"
inputButtonGenMap.setAttribute "name", "btnRun"
inputButtonGenMap.setAttribute "value", "Generate Map"
frmMenu.appendChild(inputButtonGenMap)
Set inputButtonGenMap.onclick = GetRef("GenerateMap")
Set br5= document.createElement("br")
frmMenu.appendChild(br5)
Set br6 = document.createElement("br")
frmMenu.appendChild(br6)
Set inputButtonMainMenu = document.createElement("input")
inputButtonMainMenu.setAttribute "type", "button"
inputButtonMainMenu.setAttribute "name", "btnMainMenu"
inputButtonMainMenu.setAttribute "value", "Main Menu"
frmMenu.appendChild(inputButtonMainMenu)
Set inputButtonMainMenu.onclick = GetRef("LoadMainMenuPage")
msgbox frmMenu.innerHTML
End Sub