05-02-2005, 01:49 PM
CB_ and other control functions are not used with controls in web pages. Use html element or accessible object functions.
Accessible object functions probably will not work here. Html element functions currently cannot select combobox items by text. Use this function:
Function Htm_CbSelect
Example
Accessible object functions probably will not work here. Html element functions currently cannot select combobox items by text. Use this function:
Function Htm_CbSelect
function MSHTML.IHTMLElement&el VARIANT'item ;;Selects combobox item. item can be item index (0-based) or text (exact or with *).
if(!el) end ES_INIT
MSHTML.IHTMLSelectElement elsel=+el
int index
sel item.vt
,case VT_I4
,index=item
,if(index>=elsel.length) end "item not found"
,
,case VT_BSTR
,str s(item) ss c
,c.lpstr=wild_compile(s 1 0 0)
,MSHTML.IHTMLOptionElement elop
,index=-1
,foreach elop elsel
,,ss=elop.text
,,if(c) if(!wild_matchi(c ss ss.len)) continue
,,else if(ss~s=0) continue
,,index=elop.index; goto g1
,end "item not found"
,
,case else end ES_BADARG
;g1
if(index=elsel.selectedIndex) ret
elsel.selectedIndex=index
err+ end _error
#if (IEVER>=0x532)
MSHTML.IHTMLElement3 e=+elsel
e.FireEvent("onchange")
err+
#endif
Example