In HTML, a dropdown box would be coded something like:
<option selected="selected">Saab</option>
line in the first sample. I have been trying to use an IF statement to add the selected attribute when the value equals another field on the form. The IF statement works nicely, but nothing I've tried gets the
<option selected="selected">Saab</option>
correct.
How does this need to be coded?
I have an HTA which needs to populate a dropdown box from a recordset. On load, the following code is run:<html>
<body>
<select>
<option>Volvo</option>
<option selected="selected">Saab</option>
<option>Mercedes</option>
<option>Audi</option>
</select>
</body>
</html>
This works very nicely except I need to have one of the options behave like theDo While Not rs.EOF
Set objOpt = Document.createElement("OPTION")
objOpt.Text = rs.fields(0)
objOpt.Value = rs.fields(0)
f1.selASC.Add(objOpt)
rs.MoveNext
Loop
<option selected="selected">Saab</option>
line in the first sample. I have been trying to use an IF statement to add the selected attribute when the value equals another field on the form. The IF statement works nicely, but nothing I've tried gets the
<option selected="selected">Saab</option>
correct.
How does this need to be coded?