PDA

View Full Version : JS select onChange


FatalBreeze
06-20-2007, 07:53 AM
Hello!
I have a <select> form. the first option is: -------, which is the deafult, i want that when someone changes the option from that one to another one, then another textarea is visible.
How can i do it?

Thanks!

nico_swd
06-20-2007, 08:47 AM
<select onchange="fetch_object('id_of_object').style.display = this.value == '-------' ? 'none' : 'block';">



<div id="id_of_object" style="display: none;">
<!-- content here //-->
</div>


If you're not working inside vB, replace fetch_object with document.getElementById