Ads by Lake Quincy Media
| Next Tip?
Home » Javascript

Show Hide ComboBoxes : Using JavaScript

14 March 2009 1,909 views One Comment
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

Show or Hide combobox at Runtime using JavaScript

Many a times in the programming world we feel the need to hide or show the drop1down 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 showOrHideAlldrop1Downs(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

<div style=”width:220px;” onmouseover=”showOrHideAlldrop1Downs(‘hidden’);” onmouseout=”showOrHideAlldrop1Downs(‘visible’);” >
< noscript>
your message for non script browsers
</noscript>
</div>

Popularity: 4%

Post to Twitter Tweet This Post

No related posts.

Related posts brought to you by Yet Another Related Posts Plugin.

Ads by Lake Quincy Media

One Comment »

  • shuby said:

    Good,
    you are very hard working girl

Leave your response!

You must be logged in to post a comment.

Get Adobe Flash playerPlugin by wpburn.com wordpress themes