Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Visibility=Hidden (but annoying!!!)

Status
Not open for further replies.

KingRichard3

Programmer
Feb 9, 2005
58
US
I have these two little routines:
Code:
function ShowCancelMenu()
	{
		var CancelMenu
		CancelMenu = document.getElementById('CancelMenu')
		CancelMenu.style.visibility = ''
	}
	
function HideCancelMenu()
	{
		var CancelMenu
		CancelMenu = document.getElementById('CancelMenu')
		CancelMenu.style.visibility = 'hidden'
	}
that I'm calling. The problem is that when I call the [tt]HideCancelMenu[/tt] function, although the "CancelMenu" is, in fact, hidden - i.e. it's not visible - but it still takes up space, and throws my page off center, etc.

How can I truly hide it?

Thanks so much,
Rick
 
XPBlue,

That works great - but I have one more question... That works when the user clicks the "Cancel" button. But until then, it (invisibly) hogs that space... I'm sorry for asking this, but I'm quite unfamiliar with JS. Below is my HTML page. How can I have the function HideCancelMenu be called as the page/Cancel button first loads?

Thanks so, so much!
Rick

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
	<HEAD>
		<title>PurchIS: Payment and Approver</title>
		<meta content="True" name="vs_showGrid">
		<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
		<meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE">
		<meta content="JavaScript" name="vs_defaultClientScript">
		<meta content="[URL unfurl="true"]http://schemas.microsoft.com/intellisense/ie5"[/URL] name="vs_targetSchema">
		<LINK href="[URL unfurl="true"]http://localhost/PurchIS/Styles.css"[/URL] type="text/css" rel="stylesheet">
	</HEAD>
	<body leftMargin="0" topMargin="0">
		<script src="[URL unfurl="true"]http://web.amg.advocatehealth.com/HeaderScripts.js"></script>[/URL]
		<script>
			GenerateHeader('is')
		</script>
		<form id="Form1" method="post" runat="server">
			<jlc:staticpostbackposition id="StaticPostBackPosition1" runat="server"></jlc:staticpostbackposition>
			<P align="left"><uc1:navbuttons id="NavButtons1" runat="server"></uc1:navbuttons></P>
			<P align="center"><asp:label id="lblPaymentAndApproverScreen" runat="server" Height="48px" Width="567px">[ Payment and Approver Screen text from DB ]</asp:label><br>
				<asp:label id="lblFeedbackToUser" runat="server" ForeColor="Red" Font-Bold="True"></asp:label></P>
			<P>
				<TABLE id="Table1" style="WIDTH: 576px; HEIGHT: 70px" cellSpacing="1" cellPadding="1" width="576"
					align="center" border="1">
					<TR>
						<TD style="WIDTH: 145px; HEIGHT: 19px"><asp:label id="lblDivCharged" runat="server">Division to be charged</asp:label></TD>
						<TD style="HEIGHT: 19px"><asp:dropdownlist id="cmbDivisionNames" runat="server" Width="416px" AutoPostBack="True"></asp:dropdownlist></TD>
					</TR>
					<TR>
						<TD style="WIDTH: 145px; HEIGHT: 26px">
							<P><asp:label id="lbDeptName" runat="server">Department name</asp:label></P>
						</TD>
						<TD style="HEIGHT: 26px"><asp:dropdownlist id="cmbOrganizationName" runat="server" Width="416px" AutoPostBack="True" Enabled="False"></asp:dropdownlist></TD>
					</TR>
					<TR>
						<TD style="WIDTH: 145px; HEIGHT: 20px">
							<P><asp:label id="lblCostCenter" runat="server">Cost center</asp:label></P>
						</TD>
						<TD style="HEIGHT: 20px"><asp:dropdownlist id="cmbCostCenter" runat="server" Width="416px" AutoPostBack="True" Enabled="False"></asp:dropdownlist></TD>
					</TR>
					<TR>
						<TD style="WIDTH: 145px">
							<P><asp:label id="lblNameApproverLbl" runat="server" Width="136px">Name of approver</asp:label></P>
						</TD>
						<TD><asp:label id="lblNameApproverName" runat="server" Width="416px"></asp:label></TD>
					</TR>
				</TABLE>
			</P>
			<P align="center"><asp:button id="btnNext" runat="server" Enabled="False" Text="Next"></asp:button></P>
			<DIV align="center">
				<!--****************************Cancel Menu****************************-->
				<script src="CancelScripts.js"></script>
				<INPUT onclick="ShowCancelMenu()" type="button" value="Cancel">
				<div id="CancelMenu" style="VISIBILITY: hidden; WIDTH: 300px; HEIGHT: 100px">
					<TABLE cellSpacing="0" cellPadding="0" align="center" bgColor="#ffffff" border="1">
						<TR>
							<TD>
								<P>
								<P align="center">Are you sure you would like to cancel this order?</P>
								<P align="center"><INPUT onclick="javascript:window.location='Welcome.aspx?ReqID=<%=intNewReqID%>'" type=button value=Yes>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<INPUT onclick="javascript:HideCancelMenu()" type="button" value="No">
								</P>
							</TD>
						</TR>
					</TABLE>
				</div>
			</DIV>
			<!--************************End Cancel Menu****************************--></FORM>
		<script>
				GenerateFooter()
		</script>
	</body>
</HTML>
 
You need to change the Visibility style to display. Change the following line
Code:
<div id="CancelMenu" style="VISIBILITY: hidden; WIDTH: 300px; HEIGHT: 100px">

to

Code:
<div id="CancelMenu" style="Display: none; WIDTH: 300px; HEIGHT: 100px">
 
Thanks again for replying.

That doesn't exactly work. What I want this to do is when the button is clicked it will pop up this cancel menu - prompting the user with YES/NO buttons. NO will just "re-hide" the cancel menu, whereas YES will fire another event.

If I replace the code as you suggested it, the button never pops up any menu: clicking it does nothing at all...

Thanks again,
Rick
 
Did you change the ShowCancelMenu to clear the display style instead of the visibility style?

change
Code:
function ShowCancelMenu()
    {
        var CancelMenu
        CancelMenu = document.getElementById('CancelMenu')
        CancelMenu.style.visibility = ''
    }

to

Code:
function ShowCancelMenu()
    {
        var CancelMenu
        CancelMenu = document.getElementById('CancelMenu')
        CancelMenu.style.display = ''
    }
 
The way i set up is by using layers (z-index)in css.


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
<html xmlns=" xml:lang="en">
<head>
<title>DropDown</title>
<script language="JavaScript" type="text/javascript">
<!--
function hideShow(layerID, state){
document.getElementById(layerID).style.visibility = state;
}
//-->
</script>

<style type="text/css">
<!--
body{ font-family: geneva,verdana,arial,sans-serif;}
#layer1{
background: lightblue;
width: 160px;
height: 95px;
border: solid red 1px; z-index: 2;position: absolute;
}
#btn {width: 90px; height: 24px; border: solid red 1px;
background-color: lightblue;
}

div.content{z-index:1; position: absolute;}

table {width:100%; font-size: 10px;}
tr:hover{background: yellow;}
td {height: 19px; padding-left: 0px; padding-right: 0px;}

a {width: 160px; padding: 2px; border: 0px; background: transparent; color: orange; text-decoration: none;}
a:link {color: purple;}
a:visited {color: red;}
a:hover {background: yellow; color: silver; text-decoration: underline;}
a:active {color: blue;}

-->
</style>

</head>
<body onload="hideShow('layer1','hidden')" >

<div id="btn" onClick="hideShow('layer1','visible');"><font size=-5px;>Options</font></div>

<div id="layer1" class="one" onClick="hideShow('layer1','hidden')">
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><a>Show 1</a></td></tr>
<tr><td><a href="">Show 2</a></td></tr>
<tr><td><a href="#" onClick="(aaaa.html)">Show 3</a></td></tr>

</table>
</div>

<div id="content" class="two">

Here is a sentence Here is a sentence Here is a sentence. The content wont move by the dropdown.

</div>
</body>
</html>
 
XP, if I make that change - the button never pops up any menu: clicking it does nothing at all - again...

:-(
Rick
 

Rick,

You need to apply BOTH sets of changes given by xpBSOD for them to work. One without the other will not function.

If you still have difficulty, the only possible thing I would try changing is this line in the show function:

Code:
CancelMenu.style.display = ''

to this:

Code:
CancelMenu.style.display = 'block';

Failing that, you'd need to post what code you have, after making all the modifications, and with the JS inlcuded (rather than simply giving us the link filenames), as there could be other influences at work.

Hope this helps,
Dan


The answers you get are only as good as the information you give!

 
Dan and all,

I know it's been a while since this thread was active, but I still can't get this to work.

As a quick refresher: I have a "cancel order" button on the screen. When clicked, it pops up a confirmation menu with a YES and a NO button.

Here's what's in my JavaScripts.js file:
Code:
function ShowCancelMenu()
	{
		var CancelMenu
		CancelMenu = document.getElementById('CancelMenu')
		CancelMenu.style.display = 'block' //when like this - the cancel button does nothing at all
		//CancelMenu.style.visibility = '' //when like this - the cancel button pops up the YES/NO buttons
	}
	
function HideCancelMenu()
	{
		var CancelMenu
		CancelMenu = document.getElementById('CancelMenu')
		CancelMenu.style.display = 'none' //when like this - the cancel button does nothing at all
		//CancelMenu.style.visibility = 'hidden' //when like this - the cancel button pops up the YES/NO buttons
	}
Please see the in-line comments, in the code, immediately above.

Although I don't suspect this is the problem, Dan suggested posting this (who am I to argue!) - here's the contents of the file referenced in the code, above, (at web.amg.advocatehealth....):
Code:
var RootDirectory = ""
var CurrentURL = ""
var CurrentDirectory = ""
var BreadCrumbDirectory = ""
var InPortal = ""
var sTab = ""
DropdownsToHideAndShow = new Array();
	
	
function GetDropdownsToHideAndShow(AllDocumentElements, ElementsToShowAndHide)
	{
		if ( AllDocumentElements == null )
			{
				return;
			}
		for (var i=0; i<AllDocumentElements.length; i++)
			{
				for (var j=0; j<ElementsToShowAndHide.length; j++)
					{						
						if (AllDocumentElements[i].id == ElementsToShowAndHide[j])
							{
								DropdownsToHideAndShow[DropdownsToHideAndShow.length] = AllDocumentElements[i]
							}
					}
			}	
	}

	
function HideDropDowns()
	{
		if (DropdownsToHideAndShow == null)
			{
				return; 
			}
		for (var i=0; i<DropdownsToHideAndShow.length; i++)
			{								
				DropdownsToHideAndShow[i].style.visibility = 'hidden'
			}		
	}
	
function ShowDropDowns()
	{
		if (DropdownsToHideAndShow == null)
			{
				return; 
			}
		for (var i=0; i<DropdownsToHideAndShow.length; i++)
			{								
				DropdownsToHideAndShow[i].style.visibility = ''
			}				
	}	


function MM_swapImgRestore() 
	{ //v3.0 
		var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
	}


function MM_preloadImages() 
	{ //v3.0
		var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
		var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
		if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
	}


function MM_findObj(n, d) 
	{ //v3.0
		var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
			d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
		if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
		for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
	}


function MM_swapImage() 
	{ //v3.0
		var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
		if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
	}

function GenerateHeader(SelectedTab)
	{
		CurrentURL = window.location.href
		if (CurrentURL.indexOf('[URL unfurl="true"]http://localhost/Intranet/IntranetLive/')[/URL] >= 0)
			{
				RootDirectory = '[URL unfurl="true"]http://localhost/Intranet/IntranetLive/';[/URL]
			}
		else if (CurrentURL.indexOf('[URL unfurl="true"]http://localhost/Intranet/IntranetTest/')[/URL] >= 0)
			{
				RootDirectory = '[URL unfurl="true"]http://localhost/Intranet/IntranetTest/';[/URL]
			}
		else if (CurrentURL.indexOf('[URL unfurl="true"]http://web.amg.advocatehealth.com/test/')[/URL] >= 0)
			{
				RootDirectory = '[URL unfurl="true"]http://web.amg.advocatehealth.com/test/';[/URL]
			}			
		else
			{
				RootDirectory = '[URL unfurl="true"]http://web.amg.advocatehealth.com/';[/URL]
			}		
		
		if (CurrentURL.indexOf("[URL unfurl="true"]https://access.advocatehealth.com/")[/URL] >= 0)		
			{
				RootDirectory = CurrentURL.substring(0, CurrentURL.indexOf("[URL unfurl="true"]http://",[/URL] 5) + RootDirectory.length)
				InPortal = 'Yes';
			}	
					
		document.write('<script language=javascript>');
		document.write('		function Go(){return}');
		document.write('</script>');
		
		if (SelectedTab!=='')
			{
				if (InPortal == 'Yes')
					{
						if (SelectedTab=='amg')
							{
								document.write('<script language=javascript src="[URL unfurl="true"]https://access.advocatehealth.com/http://web.amg.advocatehealth.com/test/amg/dropdown_menus.js"></script>');[/URL]
							}	
						else if (SelectedTab=='ahc')
							{
								document.write('<script language=javascript src="[URL unfurl="true"]https://access.advocatehealth.com/http://web.amg.advocatehealth.com/test/ahc/dropdown_menus.js"></script>');[/URL]
							}	
						else if (SelectedTab=='ahpo')
							{
								document.write('<script language=javascript src="[URL unfurl="true"]https://access.advocatehealth.com/http://web.amg.advocatehealth.com/test/ahpo/dropdown_menus.js"></script>');[/URL]
							}							
						else if (SelectedTab=='is')
							{
								document.write('<script language=javascript src="[URL unfurl="true"]https://access.advocatehealth.com/http://web.amg.advocatehealth.com/test/is/dropdown_menus.js"></script>');[/URL]
							}							
					}
				else
					{
						document.write('<script language=javascript src=\'' + RootDirectory + SelectedTab + '/dropdown_menus.js\'></script>');
					}	
			}
		else
			{
				if (InPortal=='Yes')
					{
						document.write('<script language=javascript src=\'[URL unfurl="true"]https://access.advocatehealth.com/http://web.amg.advocatehealth.com/test/dropdown_menus.js\'></script>');[/URL]		
					}
				else
					{
						document.write('<script language=javascript src=\'' + RootDirectory + '/dropdown_menus.js\'></script>');		
					}								
			}	
		if (InPortal=='Yes')
			{
				document.write('<script language=javascript src=\'[URL unfurl="true"]https://access.advocatehealth.com/http://web.amg.advocatehealth.com/test/menu_com.js\'></script>');[/URL]
			}
		else
			{
				document.write('<script language=javascript src=\'' + RootDirectory + 'menu_com.js\'></script>');		
			}

		document.write('<table cellpadding=0 cellspacing=0 border=0 width=100%>');
		document.write('		<tr bgcolor=6666cc height=20px>');
		document.write('			<td align=left colspan=2>&nbsp;');
		document.write('			</td>');
		document.write('		</tr>');
		document.write('		<tr height=2>');
		document.write('			<td align=left bgcolor="#6666cc" width="100px">');
		document.write('			</td>');
		document.write('			<td align=left bgcolor="#4444aa" width="800px">');
		document.write('			</td>');
		document.write('		</tr>');
		document.write('		<tr>');
		document.write('			<td align=left colspan=><img src=' + RootDirectory + 'images/header/header.jpg>');
		document.write('			</td>');
		document.write('			<td align=left colspan=>');
		document.write('				<table cellpadding=3 cellspacing=0 border=0>');
		document.write('					<tr>');
		BreadCrumbDirectory = RootDirectory

		if (CurrentURL.toLowerCase().indexOf('[URL unfurl="true"]http://cents.amg.advocatehealth.com/hdu')[/URL] >=0)
			{
				document.write('<td><a href="[URL unfurl="true"]http://cents.amg.advocatehealth.com/HDU/">HDU</a></td><td><font[/URL] size=1 color="#ff9900">&gt;</td>');
			}
		else
			{
				var InQueryString
				for (var i=RootDirectory.length; i < CurrentURL.length; i++) 
					{
						if (InQueryString != 'True')
							{
								if (CurrentURL.charAt(i)=='?')
									{
										InQueryString = 'True'
									}
								else if (CurrentURL.charAt(i)=='/')
									{
										BreadCrumbDirectory = BreadCrumbDirectory + CurrentURL.charAt(i)	
										document.write('<td><a href="' + BreadCrumbDirectory + '">' + CurrentDirectory + '</a></td><td><font size=1 color="#ff9900">&gt;</td>');
										CurrentDirectory = ''
									}
								else
									{
										BreadCrumbDirectory = BreadCrumbDirectory + CurrentURL.charAt(i)	
										CurrentDirectory = CurrentDirectory + CurrentURL.charAt(i)
									}
							}
					}
			}

		document.write('					</tr>');
		document.write('				</table>');			
		document.write('			</td>');		
		document.write('		</tr>');
		document.write('</table>');
		sTab = SelectedTab
	}	
	
	
function GenerateVisionStatement()
	{
		if (sTab=='amg') 
			{
				GenerateAMGVisionStatement()
			}
		else if (sTab=='ahc') 
			{
				GenerateAHCVisionStatement()
			}		
		else if (sTab=='ahpo') 
			{
				GenerateAHPOVisionStatement()
			}
		else if (sTab=='is') 
			{
				GenerateISVisionStatement()
			}
		else
			{
				document.write('')
			}
	}
	

function GenerateAMGVisionStatement()
	{
		document.write("<IMG SRC=" + RootDirectory + "images/156px.gif>");
		document.write("<IMG SRC=" + RootDirectory + "images/smallnew.gif>");
		document.write("<FONT size=2><EM><a href='../IS/Intranet2004amg.doc'>AMG Intranet Documentation</a></EM></FONT>");
		document.write("<p><strong>Vision Statement</strong></p>");
		document.write("<p><FONT size=2><EM>Advocate Medical Group consists of highly productive physicians and");
		document.write("	associates who provide superior quality care, excellent patient service and");
		document.write("	access to integrated health care services. The Group's success is supported by:</EM></FONT></p>");
		document.write("<p><FONT size=2><EM>Efficient operations and quality data about their practice.</EM></FONT></p>");
		document.write("<p><FONT size=2><EM>An environment enriched by teaching, research and continuous");
		document.write("	professional development.</EM></FONT></p>");
		document.write("<p><FONT size=2><EM>A culture that encourages<br>");
		document.write("	 everyone to hold each other accountable for the Group's success and<br>");
		document.write("	builds cooperation and respect among physicians, and between physicians,");
		document.write("	associates and administration.</EM></FONT></p>");
		document.write("<p><FONT size=2><EM>A commitment to managing the care and needs of the Group's patients.<br>");
		document.write("	A sharing of information within Advocate Medical Group and with patients.</EM></FONT></p>");
		document.write("<p><FONT size=2><EM>Underlying the Group's success is collaborative relationships within");
		document.write("	Advocate Lutheran General Hospital, Advocate's Health Plan and the communities"); 
		document.write("	we serve.</EM></FONT></p>");		
	}
	
	
function GenerateAHCVisionStatement()
	{
		document.write("<IMG SRC=" + RootDirectory + "images/156px.gif>");
		document.write("<IMG SRC=" + RootDirectory + "images/smallnew.gif>");
		document.write("<FONT size=2><EM><a href='../IS/Intranet2004ahc.doc'>AHC Intranet Documentation</a></EM></FONT>");
		document.write("<p><strong>Vision Statement</strong></p>");
		document.write("<p><FONT size=2><EM>Advocate Health Centers serves its patients and communities by providing");
		document.write("   health care that exceeds national standards for quality service and efficiency.  The Centers");
		document.write("   work in partnership with Advocate hospitals and the Advocate System.</EM><FONT></p>");
		document.write("<p><strong>AHC Strategies</strong></p>");
		document.write("<p><FONT size=2><EM>Strategy 1</EM></FONT></p>");
		document.write("<p><FONT size=2><EM>To align ourselves with Advocate Hospitals and the Advocate System.</EM></FONT></p>");
		document.write("<p><FONT size=2><EM>Strategy 2</EM></FONT></p>");
		document.write("<p><FONT size=2><EM>To transform our culture into one that supports rapid improvements in patient satisfaction.</EM></FONT></p>");
		document.write("<p><FONT size=2><EM>Strategy 3</EM></FONT></p>");
		document.write("<p><FONT size=2><EM>To provide excellent service to our patients and their families.</EM></FONT></p>");
		document.write("<p><FONT size=2><EM>Strategy 4</EM></FONT></p>");
		document.write("<p><FONT size=2><EM>To improve operations and reduce costs.</EM></FONT></p>");
		document.write("<p><FONT size=2><EM>Strategy 5</EM></FONT></p>");
		document.write("<p><FONT size=2><EM>To grow and diversify our patient base.</EM></FONT></p>");
	}
		
	
function GenerateAHPOVisionStatement()
	{
		document.write("<IMG SRC=" + RootDirectory + "images/156px.gif>");
		document.write("<IMG SRC=" + RootDirectory + "images/smallnew.gif>");
		document.write("<FONT size=2><EM><a href='../IS/Intranet2004ahpo.doc'>AHPO Intranet Documentation</a></EM></FONT>");
		document.write("<p><strong>Vision Statement</strong></p>");
		document.write("<p><FONT size=2><EM>Advocate Health Partners Operations vision is");
		document.write("	to be the premier management service organization in the Chicagoland area.");	
	}
	
function GenerateISVisionStatement()
	{
		document.write("<IMG SRC=" + RootDirectory + "images/156px.gif>");
		document.write("<p><strong>Vision Statement</strong></p>");
		document.write("<p><FONT size=2><EM>To place cutting edge information technology in the hands of leadership, physician and staff of Advocate Health Care");
		document.write(" while upholding their Mission, Values, and Philosophy thereby achieving clinical and service excellence and financial performance");
	}
	
function GenerateFooter()
	{
		document.write('<table cellpadding=0 cellspacing=0 border=0 width=100% height=30 bgcolor="#6666CC">');
		document.write('		<tr>');
		document.write('			<td width=100px>&nbsp;');
		document.write('			</td>');
		document.write('			<td width="*"><font color="#ffffff"><strong>[URL unfurl="true"]http://web.amg.advocatehealth.com</strong></font>');[/URL]
		document.write('			</td>');
		document.write('		</tr>');
		document.write('</table>');
		document.write('<P align=center>');
		document.write('<table cellpadding=3 cellspacing=0 border=0>');
		document.write('		<tr>');
		document.write('			<td><a href="' + RootDirectory + '">Home</a>');
		document.write('			</td>');
		document.write('			<td>|');
		document.write('			</td>');		
		document.write('			<td><a href="' + RootDirectory + 'AMG/AMGHomeWithPhoto.aspx">AMG</a>');
		document.write('			</td>');
		document.write('			<td>|');
		document.write('			</td>');
		document.write('			<td><a href="' + RootDirectory + 'AHC/AHCHome.aspx">AHC</a>');
		document.write('			</td>');
		document.write('			<td>|');
		document.write('			</td>');
		document.write('			<td><a href="' + RootDirectory + 'AHPO/AHPOhome.aspx">AHPO</a>');
		document.write('			</td>');
		document.write('			<td>|');
		document.write('			</td>');
		document.write('			<td><a href="[URL unfurl="true"]http://advocateonline.advocatehealth.com/">Advocate[/URL] Online</a>');
		document.write('			</td>');		
		document.write('		</tr>');
		document.write('</table>');
		document.write('<table cellpadding=15 cellspacing=0 border=0>');
		document.write('		<tr>');
		document.write('			<td><img src="' + RootDirectory + 'images/ft_ahclogo.gif">');
		document.write('			</td>');
		document.write('			<td>Use of our site constitutes acceptance of our <A href="[URL unfurl="true"]http://www.advocatehealth.com/system/terms.html">Terms[/URL] of Use</A>. <br>Advocate Health Care respects your privacy. <br>We invite you to view our <A href="[URL unfurl="true"]http://www.advocatehealth.com/system/privacy.html">Privacy[/URL] Policy</A>.<BR>Copyright &copy; 2003 Advocate Health Care, Oak Brook, Illinois, USA');
		document.write('			</td>');
		document.write('		</tr>');
		document.write('</table>');
		document.write('</P>');		
	}

And here's (once again) my HTML page that uses all of this stuff:
Code:
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="PaymentAndApprover.aspx.vb" Inherits="PurchIS.PaymentAndApprover"%>
<%@ Register TagPrefix="uc1" TagName="NavButtons" Src="NavButtons.ascx" %>
<%@ Register TagPrefix="jlc" Namespace="JLovell.WebControls"   Assembly="StaticPostBackPosition" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
	<HEAD>
		<title>PurchIS: Payment and Approver</title>
		<meta content="True" name="vs_showGrid">
		<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
		<meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE">
		<meta content="JavaScript" name="vs_defaultClientScript">
		<meta content="[URL unfurl="true"]http://schemas.microsoft.com/intellisense/ie5"[/URL] name="vs_targetSchema">
		<LINK href="[URL unfurl="true"]http://localhost/PurchIS/Styles.css"[/URL] type="text/css" rel="stylesheet">
	</HEAD>
	<body leftMargin="0" topMargin="0">
		<script src="[URL unfurl="true"]http://web.amg.advocatehealth.com/HeaderScripts.js"></script>[/URL]
		<script>
			GenerateHeader('is')
		</script>
		<form id="Form1" method="post" runat="server">
			<jlc:staticpostbackposition id="StaticPostBackPosition1" runat="server"></jlc:staticpostbackposition>
			<asp:Label id="lblShowOrigReqToApprover" runat="server" Visible="False"></asp:Label>
			<P align="left"><uc1:navbuttons id="NavButtons1" runat="server"></uc1:navbuttons></P>
			<P align="center"><asp:label id="lblPaymentAndApproverScreen" runat="server" Height="48px" Width="567px">[ Payment and Approver Screen text from DB ]</asp:label></P>
			<P align="center">
				<asp:label id="lblFeedbackToUser" runat="server" ForeColor="Red" Font-Bold="True"></asp:label></P>
			<P>
				<TABLE id="Table1" style="WIDTH: 576px; HEIGHT: 70px" cellSpacing="1" cellPadding="1" width="576"
					align="center" border="1">
					<TR>
						<TD style="WIDTH: 145px; HEIGHT: 19px"><asp:label id="lblDivCharged" runat="server">Division to be charged</asp:label></TD>
						<TD style="HEIGHT: 19px"><asp:dropdownlist id="cmbDivisionNames" runat="server" Width="416px" AutoPostBack="True"></asp:dropdownlist></TD>
					</TR>
					<TR>
						<TD style="WIDTH: 145px; HEIGHT: 26px">
							<P><asp:label id="lbDeptName" runat="server">Department name</asp:label></P>
						</TD>
						<TD style="HEIGHT: 26px"><asp:dropdownlist id="cmbOrganizationName" runat="server" Width="416px" AutoPostBack="True" Enabled="False"></asp:dropdownlist></TD>
					</TR>
					<TR>
						<TD style="WIDTH: 145px; HEIGHT: 20px">
							<P><asp:label id="lblCostCenter" runat="server">Cost center</asp:label></P>
						</TD>
						<TD style="HEIGHT: 20px"><asp:dropdownlist id="cmbCostCenter" runat="server" Width="416px" AutoPostBack="True" Enabled="False"></asp:dropdownlist></TD>
					</TR>
					<TR>
						<TD style="WIDTH: 145px">
							<P><asp:label id="lblNameApproverLbl" runat="server" Width="136px">Name of approver</asp:label></P>
						</TD>
						<TD><asp:label id="lblNameApproverName" runat="server" Width="416px"></asp:label></TD>
					</TR>
				</TABLE>
			</P>
			<P align="center"><asp:button id="btnNext" runat="server" Enabled="False" Text="Next"></asp:button></P>
			<DIV align="center">
				<!--****************************Cancel Menu****************************-->
				<script src="JavaScripts.js"></script>
				<asp:Panel id="pnlCancel" runat="server">
					<P><INPUT onclick="ShowCancelMenu()" type="button" value="Cancel"></P>
					<DIV id="CancelMenu" style="VISIBILITY: hidden; WIDTH: 300px; HEIGHT: 100px">
						<TABLE cellSpacing="0" cellPadding="0" align="center" bgColor="#ffffff" border="1">
							<TR>
								<TD>
									<P>
									<P align="center">Are you sure you would like to cancel this order?</P>
									<P align="center"><INPUT onclick="javascript:window.location='Welcome.aspx?ReqID=<%=intNewReqID%>'" type=button value=Yes>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<INPUT onclick="javascript:HideCancelMenu()" type="button" value="No">
									</P>
								</TD>
							</TR>
						</TABLE>
					</DIV>
				</asp:Panel>
			</DIV>
		</form>
		<script>
				GenerateFooter()
		</script>
	</body>
</HTML>

Any help would be much appreciated!!!

Thanks again!
 

I note that the functions within the "GenerateVisionStatement" function call document.write. If the "GenerateVisionStatement" function is called AFTER the page has loaded, then these calls will overwrite all the code on the page.

However, as I can see no place where GenerateVisionStatement is called from, it would be hard to comment further on this... can you tell us whether that is the case or not (i.e. is it only called after the page has loaded, or before?)

Dan


[tt]D'ya think I got where I am today because I dress like Peter Pan here?[/tt]
[banghead]

 
hang on - what if you just put the script that hides it in the <body onLoad> event, and remove the display from the style descriptor? shouldn't that iron things out?

i'm sorry if i've missed something along the way, but i really haven't read this thread thoroughly.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top