Ok, I've created an HTA that will create a table dynamically from a text file.
The text file will create a list of buttons to display, and depending on which button is pressed, the SUB will preform a specific action. (Install application, Run application, etc...)
How do I pass the value of the button to my script so that I can set up a specific action for that item?
Portion that creates the table:
strAPP = "<table border=""1"" bordercolor=""#808080"" width=""100%""><tr><th>Updates</th></tr>"
IF oFS.FileExists(<path to txt file>)THEN
SET GFILE = oFS.GetFile(<path to txt file>)
SET RFILE = GFILE.OpenAsTextStream(1,-2)
DO UNTIL RFILE.AtEndOfStream
strApps = SPLIT(setDef.ReadLine,";")
strID = strApps(0)
strVal = strApps(1)
strNam = strApps(2)
strAPP = strAPP & "<tr><td><input id=" & strID & " type=""button"" name=""" & strNam & """ value=""" & strVal & """ onclick=""RunApp""></td></tr>"
LOOP
RFILE.Close
SET RFILE = NOTHING
SET GFILE = NOTHING
END IF
strAPP = strAPP & "</table>"
strHTML = strHTML & "<tr><td>" & strAPP & "</tr></td>"
TableArea.InnerHTML = strHTML
Portion of html for table:
<span id=TableArea>Enumerating Services, Please Wait</span></center>
Now, however many buttons are created (dependant of the text file), all of them will run a SUB called "RunAPP()".
How can I distinguish which button was actually clicked?
I've tried "id.value" and "name.value", but that doesn't work. Any ideas, or a better option for what I'm trying to do?
The text file will create a list of buttons to display, and depending on which button is pressed, the SUB will preform a specific action. (Install application, Run application, etc...)
How do I pass the value of the button to my script so that I can set up a specific action for that item?
Portion that creates the table:
strAPP = "<table border=""1"" bordercolor=""#808080"" width=""100%""><tr><th>Updates</th></tr>"
IF oFS.FileExists(<path to txt file>)THEN
SET GFILE = oFS.GetFile(<path to txt file>)
SET RFILE = GFILE.OpenAsTextStream(1,-2)
DO UNTIL RFILE.AtEndOfStream
strApps = SPLIT(setDef.ReadLine,";")
strID = strApps(0)
strVal = strApps(1)
strNam = strApps(2)
strAPP = strAPP & "<tr><td><input id=" & strID & " type=""button"" name=""" & strNam & """ value=""" & strVal & """ onclick=""RunApp""></td></tr>"
LOOP
RFILE.Close
SET RFILE = NOTHING
SET GFILE = NOTHING
END IF
strAPP = strAPP & "</table>"
strHTML = strHTML & "<tr><td>" & strAPP & "</tr></td>"
TableArea.InnerHTML = strHTML
Portion of html for table:
<span id=TableArea>Enumerating Services, Please Wait</span></center>
Now, however many buttons are created (dependant of the text file), all of them will run a SUB called "RunAPP()".
How can I distinguish which button was actually clicked?
I've tried "id.value" and "name.value", but that doesn't work. Any ideas, or a better option for what I'm trying to do?