.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal

Home >> Code Snippets >> Javascript >> Post New Resource Bookmark and Share   

 Subscribe to Code Snippets

Show or Hide combobox at Runtime using JavaScript

Posted By:Meetu Choudhary       Posted Date: June 08, 2009    Points: 10    Category: Javascript    URL: http://www.dotnetspark.com  

Show or Hide combobox at Runtime using JavaScript

Many a times in the programming world we feel the need to hide or show the dropdown lists or combo boxes of the particular page or a div or anyother control so here is a small snippet

The Following is the JavaScript function to achieve the above you can embede it in any external JavaScript file or write as an inline script or include in the head section...

function showOrHideAllDropDowns(newState)

var elements = document.documentElement.getElementsByTagName('select');

for (var i=0; i
elements[i].style.visibility = newState;
} }

To use the Above function in a div we can write it like

< style="width:220px;" onmouseover="showOrHideAllDropDowns('hidden');" onmouseout="showOrHideAllDropDowns('visible');">

Thanks and Regards
Meetu Choudhary


Further Readings:


No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More code samples in C#, ASP.Net, Vb.Net and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend