hi pals,

i want to hide one select box to the web page background color..
i can set the backcolor color for select but it cant hide the dropdown triangle at the end. need help. thanks


my code is

<script language="javascript"> 
function Turnover(sel){
sel.style.backgroundColor=sel.options[sel.selectedIndex].value=='yes'?'green':''
}
</script>


<select onchange="Turnover(this)">
<option value="yes">yes</option>
<option value="no">no</option>
</select>

you really should be truly hiding it in a div tag using jquery or javascript

here's a js example

<html>
<script language="JavaScript" type="text/javascript"> <!--
function hidediv()
{
if (document.getElementById)
{
    document.getElementById('hideshow').style.visibility = 'hidden';
}
else
{
    if (document.layers)
    {
        document.hideshow.visibility = 'hidden';
    }
    else
    {
    document.all.hideshow.style.visibility = 'hidden';
    }
}
}

function showdiv()
{
    if (document.getElementById)
    {
        document.getElementById('hideshow').style.visibility = 'visible';
    }
    else
    {
        if (document.layers)
        {
            document.hideshow.visibility = 'visible';
        }
        else
        {
            document.all.hideshow.style.visibility = 'visible';
        }
    }
}
-->
</script>
<body>
<div id="hideshow" >
Content that will be shown and hidden
</div>

<a href="javascript:hidediv()">Hide div</a>

<a href="javascript:showdiv()">show div</a>
</body>
</html>

you really should be truly hiding it in a div tag using jquery or javascript

here's a js example

<html>
<script language="JavaScript" type="text/javascript"> <!--
function hidediv()
{
if (document.getElementById)
{
    document.getElementById('hideshow').style.visibility = 'hidden';
}
else
{
    if (document.layers)
    {
        document.hideshow.visibility = 'hidden';
    }
    else
    {
    document.all.hideshow.style.visibility = 'hidden';
    }
}
}

function showdiv()
{
    if (document.getElementById)
    {
        document.getElementById('hideshow').style.visibility = 'visible';
    }
    else
    {
        if (document.layers)
        {
            document.hideshow.visibility = 'visible';
        }
        else
        {
            document.all.hideshow.style.visibility = 'visible';
        }
    }
}
-->
</script>
<body>
<div id="hideshow" >
Content that will be shown and hidden
</div>

<a href="javascript:hidediv()">Hide div</a>

<a href="javascript:showdiv()">show div</a>
</body>
</html>

thanks for ur reply...

another problem..
i need to get on-focus for a text box... by java script i can get onfocus but what my problem is im not navigating to that page properly, if i enter any characters im navigated to that textbox.
can u suggest any methods to overcome for it

thanks for ur reply...

another problem..
i need to get on-focus for a text box... by java script i can get onfocus but what my problem is im not navigating to that page properly, if i enter any characters im navigated to that textbox.
can u suggest any methods to overcome for it

I'm not understanding the question for this new one.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.