Hi.
I have wrote a dynamic drop down list function, and it works fine.....well it works fine in IE on the PC.
The problem occurs when using IE 5.1 on the MAC.
The drop down list is still created dynamically and the correct data is held within it, its just that within my function it checks to see whether 2 values are the same and if they are then it checks the relevant item as 'selected' then carries on creating the drop down list if it isnt eof.
On the MAC though it does check the item, but doesnt display it. So the drop list appears blank until you tab over it or select it and then suddenly the item shows....its almost as if its white text on white background and giving focus to the field changes the text to black....very weird!
Heres my code:
-------------------------------------------------------
Function MakeSelect(strName,strTable,strField,strDesc,strSelected)
strSqlMk = "SELECT " & strTable & ".[" & strField & "], " & strTable &".[" & strDesc & "]"
strSqlMk = strSqlMk & " FROM " & strTable & " ORDER BY " &strTable & ".[" & strField & "];"
Set Rs = GetRecordSet(strSqlMk)
ArrData = Rs.getrows
nNumcols=ubound(ArrData,1)
nNumrows=ubound(ArrData,2)
strFinal = "<select name=" & strName & " autocomplete=""off"">"
strFinal = strFinal & "<option value=></option>"
for i = 0 to ubound(ArrData,2)
if ArrData(0,i) = strSelected then
strFinal = strFinal & "<option value=""" & ArrData(0,i) & """ selected>" & ArrData(1,i) & "<br></option>"
else
strFinal = strFinal & "<option value=""" & ArrData(0,i) & """>" & ArrData(1,i) & "<br></option>"
end if
next
strFinal = strFinal & "</select>"
MakeSelect = strFinal
End Function
'This is the code you insert on the page to create the drop down list
<%=MakeSelect("DROP DOWN VALUE","TABLE NAME","ORDER BY FIELD","DROP DOWN ITEM",VALUE TO CHECK)%>
-------------------------------------------------------
Quick explanation on the MakeSelect Function
DROP DOWN VALUE = The 'value' of the item in the list
TABLE NAME = Name of Table the data is taken from
ORDER BY FIELD = Order the list by this field name
DROP DOWN ITEM = Data displayed in the list (*not* value)
VALUE TO CHECK = This value is what defines what item in the list is selected.
I hope you can understand all this.
Any help would be much appreciated. If you need anymore code as I may have missed some out, then please let me know.
- FateFirst - FateFirst
I have wrote a dynamic drop down list function, and it works fine.....well it works fine in IE on the PC.
The problem occurs when using IE 5.1 on the MAC.
The drop down list is still created dynamically and the correct data is held within it, its just that within my function it checks to see whether 2 values are the same and if they are then it checks the relevant item as 'selected' then carries on creating the drop down list if it isnt eof.
On the MAC though it does check the item, but doesnt display it. So the drop list appears blank until you tab over it or select it and then suddenly the item shows....its almost as if its white text on white background and giving focus to the field changes the text to black....very weird!
Heres my code:
-------------------------------------------------------
Function MakeSelect(strName,strTable,strField,strDesc,strSelected)
strSqlMk = "SELECT " & strTable & ".[" & strField & "], " & strTable &".[" & strDesc & "]"
strSqlMk = strSqlMk & " FROM " & strTable & " ORDER BY " &strTable & ".[" & strField & "];"
Set Rs = GetRecordSet(strSqlMk)
ArrData = Rs.getrows
nNumcols=ubound(ArrData,1)
nNumrows=ubound(ArrData,2)
strFinal = "<select name=" & strName & " autocomplete=""off"">"
strFinal = strFinal & "<option value=></option>"
for i = 0 to ubound(ArrData,2)
if ArrData(0,i) = strSelected then
strFinal = strFinal & "<option value=""" & ArrData(0,i) & """ selected>" & ArrData(1,i) & "<br></option>"
else
strFinal = strFinal & "<option value=""" & ArrData(0,i) & """>" & ArrData(1,i) & "<br></option>"
end if
next
strFinal = strFinal & "</select>"
MakeSelect = strFinal
End Function
'This is the code you insert on the page to create the drop down list
<%=MakeSelect("DROP DOWN VALUE","TABLE NAME","ORDER BY FIELD","DROP DOWN ITEM",VALUE TO CHECK)%>
-------------------------------------------------------
Quick explanation on the MakeSelect Function
DROP DOWN VALUE = The 'value' of the item in the list
TABLE NAME = Name of Table the data is taken from
ORDER BY FIELD = Order the list by this field name
DROP DOWN ITEM = Data displayed in the list (*not* value)
VALUE TO CHECK = This value is what defines what item in the list is selected.
I hope you can understand all this.
Any help would be much appreciated. If you need anymore code as I may have missed some out, then please let me know.
- FateFirst - FateFirst