Hiding Combo box controls generically using JavaScript

Hi can anyone help?

I am trying to write a bit of javascript that will hide a html combo box control. I know that you can use

<code>

ControlName.style.display = 'block'
ControlName.style.display = 'none'

</code>

however I want to say something like:

<pseudocode>

For Each control in htmlpage.Controls
if control.Type = htmlComboBox
control.style.display = 'none'
end if
next

</pseudocode>

(Sorry for the VB type psuedo! VB is better for pseudocoding!)

Therefore, whenever the code is excuted, all of the Combo Box controls on the page will be hidden.

Thankyou in anticipation,

Alan C
[780 byte] By [alcOrtholite] at [2007-11-18 18:32:39]
# 1 Re: Hiding Combo box controls generically using JavaScript
You could use getElementsByTagName for this:

var iSelect = document.getElementsByTagName('SELECT')
for(i=0;i<iSelect.length;i++) iSelect[i].style.display="none"
webworldx at 2007-11-8 0:19:16 >