
05/04/2005, 07:33
|
 | | | Fecha de Ingreso: agosto-2002 Ubicación: Hangar 18
Mensajes: 1.703
Antigüedad: 22 años, 8 meses Puntos: 16 | |
checa este codigo.
funciona dado un XML.
se queno es lo mismo, pero te da una idea de como hacerlo. con un recordset.
Código:
sub creacombobox(objetoxml,fieldrowname,idfield,glosafield,style,comboname,comboaction,combotit,combotitvalue,desabilitado)
set xmldom = server.createobject("msxml2.domdocument")
xmldom.loadxml(objetoxml)
set hrow = xmldom.getelementsbytagname(fieldrowname)
if desabilitado = 1 then
escribe("<select disable size=""1"" name="""& comboname &""" class= """& style &""" onchange="""& comboaction &""" >")
else
escribe("<select size=""1"" name="""& comboname &""" class= """& style &""" onchange="""& comboaction &""" >")
end if
for hcount = 0 to hrow.length -1
if fieldfromnrecord( hrow.item(hcount), idfield) = combotitvalue then
aux = 1
escribe("<option selected value=""" & fieldfromnrecord( hrow.item(hcount), idfield) &""">" & fieldfromnrecord( hrow.item(hcount), glosafield) & "</option>")
else
escribe("<option value=""" & fieldfromnrecord( hrow.item(hcount), idfield) &""">" & fieldfromnrecord( hrow.item(hcount), glosafield) & "</option>")
end if
next
if aux <> 1 then
escribe("<option value="""" selected>"& combotit &"</option>")
end if
escribe("</select>")
set yrow = nothing
set xmldom = nothing
end sub
|