Hey guys have her an code where i add an option to a html dropdownbox with vbscript. But i want this added option set as default how can i do this. Here is the code:
Sub Window_OnLoad
ForReading = 1
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile _
("C:\Temp\CAD_Kunde.txt", ForReading)
Do Until objFile.AtEndOfStream
strLine = objFile.ReadLine
Set objOption = Document.createElement("OPTION")
objOption.Text = strLine
objOption.Value = strLine
formname.select1.Add(objOption)
Loop
objFile.Close
End Sub
This should work:
I hope you’re aware that client side VBScript is really really bad idea for any public website?