HighDots Forums  

innerHTML di un tag <SELECT>

Javascript (Italian) Il linguaggio JavaScript (it.comp.lang.javascript)


Discuss innerHTML di un tag <SELECT> in the Javascript (Italian) forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Cristian Martinello
 
Posts: n/a

Default innerHTML di un tag <SELECT> - 10-15-2003 , 10:58 AM






E' possibile modificare tale tag in modo da aggiungere delle option ?

Io ho il seguente codice:

for(var i=0; i<xmlTemp.documentElement.childNodes.length;i++)
{
strHtml+="<option>" +
xmlTemp.documentElement.childNodes(i).getAttribute ('cognome')+"</option>"
}
combo.innerHTML=strHtml

dove combo è l'id della mia select, ma quando vado a scrivere
l'innerHTML, taglia "<option>" dalla stringa, e ovviamente non compare
nessun elemento selezionabile.

Qualche consiglio ?

Grazie.


--
Posted via Mailgate.ORG Server - http://www.Mailgate.ORG

Reply With Quote
  #2  
Old   
Cristiano Larghi
 
Posts: n/a

Default Re: innerHTML di un tag <SELECT> - 10-15-2003 , 11:28 AM






Non ho mai usato questo approccio, ma non mi stupisce se non funziona...

Approccio un po' più "umano":

http://www.jsdir.com/staffscripts/script070.asp



Reply With Quote
  #3  
Old   
Cristian Martinello
 
Posts: n/a

Default Re: innerHTML di un tag <SELECT> - 10-15-2003 , 11:38 AM



"Cristiano Larghi" <c.larghi_NOSPAM (AT) editaliasrl (DOT) it> wrote


Quote:
Non ho mai usato questo approccio, ma non mi stupisce se non funziona...

Approccio un po' più "umano":

http://www.jsdir.com/staffscripts/script070.asp
Non trovo il nesso con la mia situazione:
Io devo scorrere un file xml, ed in base a quanti nodi contiene,
inserire una option.


--
Posted via Mailgate.ORG Server - http://www.Mailgate.ORG


Reply With Quote
  #4  
Old   
Cristian Martinello
 
Posts: n/a

Default Re: innerHTML di un tag <SELECT> - 10-15-2003 , 11:53 AM



"Cristiano Larghi" <c.larghi_NOSPAM (AT) editaliasrl (DOT) it> wrote


Quote:
Non ho mai usato questo approccio, ma non mi stupisce se non funziona...

Approccio un po' più "umano":

http://www.jsdir.com/staffscripts/script070.asp
Ad ogni modo ho preso l'ispirazione ed ho risolto.
Grazie :-)


--
Posted via Mailgate.ORG Server - http://www.Mailgate.ORG


Reply With Quote
  #5  
Old   
Cristiano Larghi
 
Posts: n/a

Default Re: innerHTML di un tag <SELECT> - 10-15-2003 , 12:00 PM



ecco, era l'ispirazione di cui parlavo...come scorrerlo lo sapevi già fare,
era come inserirlo come option che mancava...



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.