Discussion:
Trouble Modifying dsiplay style
Brady Kelly
2008-02-26 18:01:16 UTC
Permalink
I'm trying to get a DIV to display at will, as a sort of dialog, but I'm
stuck on setting the display as follows. Please could someone suggest why
this isn't working:





function showSearchAndReplace()

{

var dSr = document.getElementById("divSR");

dSr.style.display="inline";

debugger;

return true;

}





My DIV is marked up as:



div id="divSR" style="display: none;"


===================================
This list is hosted by DevelopMentor� http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com
Efran Cobisi, cobisi.com
2008-02-26 18:36:18 UTC
Permalink
Hi Brady,

You should set the display to "block", not "inline".
That is:

document.getElementById('divSR').style.display = 'block';

HTH

--
Efran Cobisi
http://www.cobisi.com
Post by Brady Kelly
I'm trying to get a DIV to display at will, as a sort of dialog, but I'm
stuck on setting the display as follows. Please could someone suggest why
function showSearchAndReplace()
{
var dSr = document.getElementById("divSR");
dSr.style.display="inline";
debugger;
return true;
}
div id="divSR" style="display: none;"
===================================
This list is hosted by DevelopMentor® http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com
===================================
This list is hosted by DevelopMentor® http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com
Brady Kelly
2008-02-26 18:50:06 UTC
Permalink
Post by Efran Cobisi, cobisi.com
You should set the display to "block", not "inline".
document.getElementById('divSR').style.display = 'block';
--
Efran Cobisi
Thanks, but I tried block as well. I'm calling the show function from an
asp:button, and it was showing until the postback, which I never saw because
the debugger popped up in the way, an then on post back it reset the display
attribute. I added "return false;" to the client-side onclick event and
that seems to have cleared it up.

===================================
This list is hosted by DevelopMentor� http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com
Efran Cobisi, cobisi.com
2008-02-26 20:48:43 UTC
Permalink
I'm calling the show function from an asp:button
Ok, this was the culprit. If you don't need server side processing fired
by that button then you don't need it to be a server side control either.
Why don't having a simple html input button?
I added "return false;" to the client-side onclick event and
that seems to have cleared it up.
Fine; returning false avoid continuing with the postback sequence.

HTH

--
Efran Cobisi
http://www.cobisi.com

===================================
This list is hosted by DevelopMentor® http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com
Brady Kelly
2008-02-26 20:58:27 UTC
Permalink
Post by Efran Cobisi, cobisi.com
I'm calling the show function from an asp:button
Ok, this was the culprit. If you don't need server side processing fired
by that button then you don't need it to be a server side control either.
Why don't having a simple html input button?
--
Efran Cobisi
We have inherited server side code in all pages that enables and disables
buttons based on user rights.

===================================
This list is hosted by DevelopMentor� http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com
Loading...