Sunday, April 13, 2008

Complete set of show hide div with javaScript and html

[script language="javascript" type="text/javascript"]
function ChkInvalidSmileRequest()

{

var chkStrSmile = '[%=chkStrSmile %]' ;

if(chkStrSmile == "invalidRequest")
{

document.getElementById("[%=divInvalidSmileRequest.ClientID%]").style.visibility= 'visible';


document.getElementById("[%=divInvalidSmileRequest.ClientID%]").style.display='block';

document.getElementById("[%=divInvalidSmileRequest.ClientID%]").style.position="absolute";

document.getElementById("ctl00_ContentPlaceHolder1_imgSendSmile").disabled = true;


return false;
}


}
function divInvalidSmileRequestClose()
{

document.getElementById("[%=divInvalidSmileRequest.ClientID%]").style.display='none';
document.getElementById("[%=divInvalidSmileRequest.ClientID%]").style.visibility='hidden';
document.getElementById("ctl00_ContentPlaceHolder1_imgSendSmile").disabled = false;

return false;
}

[/script]


[div id="divInvalidSmileRequest" style="visibility: hidden; z-index: 3; display: none; background-color: #ffffff;
border: 1px solid #cccccc; left:450px; top:200px;" runat="server" ]
[table width="250px" border="0" cellpadding="0" cellspacing="0"]
[tr]
[td valign="top" class="heading_white2" style="background-image: url(images/grey_box_small_middle.gif);
background-repeat: repeat-x; width: 250px;height: 30px;"]
 YourLocal Message
[/td]
[td valign="top" style="background-image: url(images/grey_box_small_middle.gif);
background-repeat: repeat-x; width: 22px" align="right"]

[/td]
[/tr]
[tr]
[td colspan="2"]
[table cellpadding="0" style="padding-top: 20px;" cellspacing="0" border="0" width="100%"]
[tr]
[td colspan="3"]
[/td]
[/tr]
[tr]
[td rowspan="3"]
[/td]
[td style="width: 5px;height: 15px;"]
[/td]
[td align="center" class="blue_light1"]
Invalid smile request !
[/td]
[/tr]
[tr]
[td colspan="3" style="height: 15px;"]
[/td]
[/tr]
[/table]
[/td]
[/tr]
[tr]
[td colspan="2" style="height: 20px;" align="center"]
[asp:ImageButton ID="OkButton" runat="server" ImageUrl="~/images/ok_btn.gif" AlternateText="Okay" OnClientClick="return divInvalidSmileRequestClose()" /]

[/td]
[/tr]
[tr]
[td align="center" colspan="2" style="height: 15px;"]

[/td]
[/tr]

[/table]
[/div]

No comments: