Hi Everyone,
I wonder if you can help. I have a hta file which loads in a directory of files from a database.
When the user clicks the select box (dir2) I want a message box to display what option they selected. Can anyone help. This is my code:
I wonder if you can help. I have a hta file which loads in a directory of files from a database.
When the user clicks the select box (dir2) I want a message box to display what option they selected. Can anyone help. This is my code:
Code:
<html>
<head>
<title></title>
<link rel="stylesheet" type="text/css" href="" />
<HTA:APPLICATION
ID="objHTAHelpomatic"
APPLICATIONNAME=""
SINGLEINSTANCE="yes"
WINDOWSTATE="normal"
MAXIMIZEBUTTON="No"
SCROLL="NO"
BORDER="Dialog"
ICON = ""
>
</head>
******** Language="VBScript">
Sub Window_******
window.resizeTo 800,670
End Sub
Sub FillNames()
Dim sConnect
Dim objCmd
Dim objRS
sConnect = "Provider=Microsoft.Ace.OLEDB.12.0;Data Source=db.accdb;Persist Security Info=False"
Set objCmd = CreateObject("ADODB.Command")
objCmd.ActiveConnection = sConnect
objCmd.CommandText = "SELECT [normalised_name] FROM tbl_dir;"
Set objRS = CreateObject("ADODB.Recordset")
Set objRS = objCmd.Execute
While Not objRS.EOF
Set objOption = Document.createElement("OPTION")
objOption.Text = objRS("normalised_name")
objOption.Value = objRS("normalised_name")
dir_list.Add(objOption)
objRS.MoveNext
Wend
objRS.Close
Set objRS = Nothing
End Sub
Sub FillDesc
Dim sConnect
Dim objCmd
Dim objRS
sConnect = "Provider=Microsoft.Ace.OLEDB.12.0;Data Source=db.accdb;Persist Security Info=False"
Set objCmd = CreateObject("ADODB.Command")
objCmd.ActiveConnection = sConnect
objCmd.CommandText = "SELECT [normalised_name] FROM tbl_dir;"
Set objRS = CreateObject("ADODB.Recordset")
Set objRS = objCmd.Execute
While Not objRS.EOF
Set objOption = Document.createElement("OPTION")
objOption.Text = objRS("normalised_name")
objOption.Value = objRS("normalised_name")
dir_list.Add(objOption)
objRS.MoveNext
Wend
objRS.Close
Set objRS = Nothing
End Sub
Sub test(obj)
msgbox dir2.value
End Sub
*********>
****** ******="FillNames()">
<div id="left">
<h3>Directory</h3>
<select id="dir2" size="5" name="dir_list" style="height:500;width:350" *******="test"></select>
</div>
<div id="right">
<h3>Description</h3>
<textarea rows="4" cols="50" style="width:400;height:300"></textarea>
</div>
</body>
</html>