Click here to Skip to main content
15,888,802 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm sure I have pretty simple question but for some reasons I can't find answer
I have a basic JS function to show an element

function show(obj1) {
var div = document.getElementById(obj1);
div.style.display = 'inline';
}

.....

<a önclick="show('Div')>Show Panel</a><br mode=" hold=" /><div id=" div="  runat=" server=" style=" none="><br mode=" btnsearch=" runat=" search=" OnClick=" btnsearch_click=" /><br mode=" display=", " inline="");<br mode="hold" />//and Div.Style("display") = "inline";<br mode="hold" />//and Div.Visible = true;<br mode="hold" />}</pre><br mode="hold" />no matter what I do, it gets hidden.</xml>"></a>
Posted
Updated 27-Jul-11 11:52am
v4

How do you know for sure you want it shown on postback ? Does the div get set to the valye you want, even if it's not shown ? What if you set it based on a property that returns inline on postback, and none on first render ?
 
Share this answer
 
I just wanted to implement "Advanced Search panel"
When <a onclick="show('Div')>Show Panel</a> clicked, a panel with all advanced filters will be shown, including Search and Hide buttons. It also has a Results dropdown which is populated on Search click, so I don't want to hide the panel on the Search click. But it hides anyway
 
Share this answer
 
Comments
Christian Graus 27-Jul-11 15:30pm    
Don't push 'answer' to ask questions. A questin is not an answer. Did you try what I suggested ?
esb77 29-Jul-11 16:08pm    
sorry, not sure what you suggested

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900