hi friends.. In asp.net , i want to show the gridview when keypress in textbox.. how to do in javascript..

Recommended Answers

All 6 Replies

txtbox.attributes.add("onkeypress","javascript:return gridvisible();");

<script>
function gridvisible()
{
var gd=document.getelementbyid("u r gridview id");
gd.style.visibility="visible";
//in case u want to  the gridview to be not visible use this
gd.style.visibility="hidden";

}

</script>

sir... i want to set visible=true for gridview when i keypress in textbox.. in asp.net

txtbox.attributes.add("onkeypress","javascript:return gridvisible();");

<script>
function gridvisible()
{
var gd=document.getelementbyid("u r gridview id");
gd.style.visibility="visible";
//in case u want to  the gridview to be not visible use this
gd.style.visibility="hidden";

}

</script>

Thank u Sir.. But i hv one problem. when my page load, control should be visible=false.. when i keypress in textbox, it'll be visible=true..
i hv set visible=false in design.. then used that javascript code.. it s not work out.. if possible, can u solve my problem

add this to the design view of gridview

Style="visibility: hidden"

Thank u very much sir.. i got it...

if so then its better u mark the thread as solved so that others wont view this thread

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.