Web Analytics Made Easy -
StatCounter document.[form] has no prooperties - CodingForum

Announcement

Collapse
No announcement yet.

document.[form] has no prooperties

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • document.[form] has no prooperties

    Hello!


    The following code works fine in IE, but Netscape delivers the JavaScript error: "document.Gateway has no properties".


    Has anybody got any idea why Netscape thinks that the form named 'Gateway' has no properties?

    It's driving me insane!!!!


    I've trimmed the markup down a little bit, but it's still quite large, so sorry about the size.


    Any help, even a decent link to some appropriate online info, would be greatly appreciated!


    Code:
    	<!--javascript call.......-->
    		<script>writeHidden(document.Gateway.DivMemoryText);</script>
    				
    	<body>
    		
    			
    		<div id="wrap" style="direction:ltr;"><!--start #wrap-->
    				
    		<table class="table_stack" cellspacing="1" style="border-bottom: #6C9182 3px double;">
    		<tr>
    			<td style="padding-left: 5%; width: 20%;
    			background: url(../pics/blurblocks2.gif) top left no-repeat;">
    				<table style="background: url(../pics/linefade.gif) top repeat-x;
    				padding: 5px; border: #6C9182 2px solid;">
    					<tr>
    						<td>
    							<input type="text" id="searchbox" value="Search..." onfocus="this.value='';" />
    						</td>
    						<td>
    							<input type="submit" value="GO!" />
    						</td>
    					</tr>
    				</table>
    			</td>
    			<td style="text-align: right;"><img src="../pics/logo.jpg" width="565px" height="90px" /></td>
    		</tr>
    		<tr>
    			<td colspan="2" style="text-align: right; background: url(../pics/linefade.gif) top right repeat-x;">
    				
    			
    			<div style="padding: 2px;">
    				<a id="myhome" style="font-size: 120%; color: #007100; border: none; padding: 4px;" href="../index.asp">Home</a>
    				<a id="page1" style="font-size: 120%; color: #007100; border: none; padding: 4px;" href="tempconstr.asp">Portfolio</a>
    				<a id="page2" style="font-size: 120%; color: #007100; border: none; padding: 4px;" href="gate.asp">Guestbook</a>
    			</div>
    			
    
    			</td>
    		</tr>
    	</table>
    	
    	
    
    						
    		
    		<form id="Gateway" name="Gateway" method="post" onsubmit="writeHidden(Gateway.DivMemoryText)">
    		
    		<table id="myTable" name="myTable" class="table_stack" cellspacing="2" cellpadding="2" style="margin-left: 10%; margin-top: 20px; width: 80%; border: #6C9182 1px solid;">
    			<tr>
    				<td width="30%" style="border: #6C9182 1px solid; text-align: center;">
    					
    					<p>text here</p>
    									
    				</td>
    				<td>
    					
    							
    					<!--javascript call.......-->
    					<div id="tester" onscroll="writeScroll(this);" style="height: 400px; overflow: scroll; margin-right: 2%;">
    						
    										
    <table style='width: 100%;'>
             <!--table content goes here in the actual document-->
    <table>
    					
    					<input type="hidden" name="DivMemoryText" id="DivMemoryText" />				
    					</div>
    				</td>
    			</tr>
    		</table>
    		</form>
    	<div id="border"></div>
    
    
    					<!--javascript call.......-->
    	<script language="JavaScript">setScrollXY(window.tester, '');</script>
    
    	
    
    
    				
    </div><!--end #wrap-->
    
    
    
    </body>
    
    
    
    </html>

  • #2
    Code looks fine but we need to know what your writeHidden function code looks like.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

    Comment


    • #3
      Thanks for your quick reply!

      Here's all the JavaScript that I'm using:



      Code:
      <script>
      
      
      var test;
      
      			function getScrollXY(passedVal)
      			{
      				var scrOfX = 0, scrOfY = 0;
      					if( typeof( passedVal.pageYOffset ) == 'number' )
      					{
      					 //Netscape compliant
      						scrOfY = passedVal.pageYOffset;
      						scrOfX = passedVal.pageXOffset;
      					} 
      					else
      					{
      						if( passedVal && ( passedVal.scrollLeft || passedVal.scrollTop ) )
      						{
      							//DOM compliant
      							scrOfY = passedVal.scrollTop;
      							scrOfX = passedVal.scrollLeft;
      						}
      						else
      						{
      							if( passedVal.documentElement && ( passedVal.documentElement.scrollLeft || passedVal.documentElement.scrollTop ) )
      							{
      								//IE6 standards compliant mode
      								scrOfY = passedVal.documentElement.scrollTop;
      								scrOfX = passedVal.documentElement.scrollLeft;
      							}
      						}
      					}
      			return [ scrOfX, scrOfY ];
      			}
      			
      		
      		
      		
      		
      			function setScrollXY(objDivName, strVBDictVar)
      				{					
      					if (strVBDictVar != "" && strVBDictVar != "undefined")
      					{
      						objDivName.scrollTop = strVBDictVar;
      					}
      				}
      		
      		
      		
      		
      		
      		
      							
      				
      				function writeHidden(objFieldName)
      				{
      					objFieldName.value = test;
      					
      				}
      	
      	
      				function writeScroll(val)
      				{
      					var retTest = new Array(2);
      						retTest = getScrollXY(val)
      						
      						test = retTest[1];
      					
      					
      					
      				}
      				
      				
      							
      
      </script>


      No idea whether it makes any difference, but I'm trying to record and reset the position of a scrollable div after its containing form is submitted (so that the scrollbar won't snap back to its default location every time the user presses a submit buton). The original code was inside an .asp.

      The setScrollXY function accepts the name/id of a div and the value of a VBScript dictionary variable.

      Comment


      • #4
        Try this
        Code:
        <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
        <html>
        <head>
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
        <title>Untitled Document</title>
        <script type="text/javascript">
        
        
        var test;
        
        			function getScrollXY(passedVal)
        			{
        				var scrOfX = 0, scrOfY = 0;
        					if( typeof( passedVal.pageYOffset ) == 'number' )
        					{
        					 //Netscape compliant
        						scrOfY = passedVal.pageYOffset;
        						scrOfX = passedVal.pageXOffset;
        					} 
        					else
        					{
        						if( passedVal && ( passedVal.scrollLeft || passedVal.scrollTop ) )
        						{
        							//DOM compliant
        							scrOfY = passedVal.scrollTop;
        							scrOfX = passedVal.scrollLeft;
        						}
        						else
        						{
        							if( passedVal.documentElement && ( passedVal.documentElement.scrollLeft || passedVal.documentElement.scrollTop ) )
        							{
        								//IE6 standards compliant mode
        								scrOfY = passedVal.documentElement.scrollTop;
        								scrOfX = passedVal.documentElement.scrollLeft;
        							}
        						}
        					}
        			return [ scrOfX, scrOfY ];
        			}
        			
        		
        		
        		
        		
        			function setScrollXY(objDivName, strVBDictVar)
        				{					
        					if (strVBDictVar != "" && strVBDictVar != "undefined")
        					{
        						objDivName.scrollTop = strVBDictVar;
        					}
        				}
        		
        		
        		
        		
        		
        		
        							
        				
        				function writeHidden(objFieldName)
        				{
        					objFieldName.value = test;
        					
        				}
        	
        	
        				function writeScroll(val)
        				{
        					var retTest = new Array(2);
        						retTest = getScrollXY(val)
        						
        						test = retTest[1];
        					
        					
        					
        				}
        				
        				
        							
        
        function writeHidden(objFieldName)
        {
        objFieldName.value = test;
        return false;
        }
        window.onload = function()
        {
        	writeHidden(document.getElementById('DivMemoryText'));
        }
        </script>
        </head>
        <body>
        <div id="wrap">
        	<!--start #wrap-->
        	<table class="table_stack" cellspacing="1" style="border-bottom: #6C9182 3px double;">
        		<tr>
        			<td style="padding-left: 5%; width: 20%; background: url(../pics/blurblocks2.gif) top left no-repeat;"><table style="background: url(../pics/linefade.gif) top repeat-x;padding: 5px; border: #6C9182 2px solid;">
        					<tr>
        						<td><input type="text" id="searchbox" value="Search..." onFocus="this.value='';">
        						</td>
        						<td><input type="submit" value="GO!">
        						</td>
        					</tr>
        				</table></td>
        			<td style="text-align: right;"><img src="../pics/logo.jpg" width="565" height="90" alt=""></td>
        		</tr>
        		<tr>
        			<td colspan="2" style="text-align: right; background: url(../pics/linefade.gif) top right repeat-x;"><div style="padding: 2px;"> <a id="myhome" style="font-size: 120%; color: #007100; border: none; padding: 4px;" href="../index.asp">Home</a> <a id="page1" style="font-size: 120%; color: #007100; border: none; padding: 4px;" href="tempconstr.asp">Portfolio</a> <a id="page2" style="font-size: 120%; color: #007100; border: none; padding: 4px;" href="gate.asp">Guestbook</a> </div></td>
        		</tr>
        	</table>
        	<form id="Gateway" name="Gateway" method="post" action="#" onSubmit="return writeHidden(Gateway.DivMemoryText)">
        		<table id="myTable" class="table_stack" cellspacing="2" cellpadding="2" style="margin-left: 10%; margin-top: 20px; width: 80%; border: #6C9182 1px solid;">
        			<tr>
        				<td width="30%" style="border: #6C9182 1px solid; text-align: center;"><p>text here</p></td>
        				<td><!--javascript call.......-->
        					<div id="tester" onscroll="writeScroll(this);" style="height: 400px; overflow: scroll; margin-right: 2%;">
        						<!--table content goes here in the actual document-->
        						<input type="hidden" name="DivMemoryText" id="DivMemoryText">
        						<p> Lorem ipsum dolor sit amet, consectetuer adipiscing elit. In fermentum lectus a turpis. Nunc consequat elit sed enim. Vivamus ultricies. Fusce et nibh sit amet velit varius lobortis. Vivamus euismod erat sed neque. Duis tempus dapibus diam. Proin quam felis, scelerisque vitae, tristique sit amet, elementum eu, tellus. Nam urna ante, nonummy vitae, lobortis vel, rhoncus quis, leo. Quisque sodales elit a risus. Curabitur molestie. Etiam congue sapien sed ante. Pellentesque metus diam, egestas at, sollicitudin a, varius a, felis. </p>
        						<p> Donec tincidunt nisi at quam. Mauris sed libero eget enim elementum condimentum. Nam ac metus sed risus sollicitudin aliquet. Aenean ut metus vitae lectus congue blandit. Sed quis nulla sed diam elementum rhoncus. In bibendum, tortor vel pharetra dapibus, ligula ante condimentum orci, nec ultricies purus odio nec leo. In pulvinar sapien id ante. Aliquam aliquet elit non velit. In vulputate. Quisque porta ante sed ipsum. Duis vulputate. </p>
        						<p> Nullam cursus. Maecenas varius urna. Fusce luctus vulputate orci. Praesent sapien. Phasellus convallis felis nec nunc. Aliquam nisi. Pellentesque hendrerit lorem eget nisl. Vivamus eget lorem. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Nulla nonummy nisi a massa. Aliquam sed elit sit amet nibh rhoncus condimentum. Donec turpis nisi, faucibus ut, egestas tempus, laoreet quis, purus. Quisque orci. Suspendisse venenatis, risus sed accumsan cursus, magna lorem rhoncus mi, vitae condimentum urna nisi at arcu. Quisque quis ante et libero euismod vulputate. Nulla tristique, nunc vel fringilla volutpat, nunc nibh mattis felis, sed interdum sem libero ut orci. Vestibulum sem sapien, dapibus dignissim, egestas ut, consectetuer at, nisl. </p>
        						<p> Nulla vulputate leo id nibh. Sed pulvinar, est at porta hendrerit, est dui molestie pede, eu tincidunt ipsum lacus placerat orci. Duis ullamcorper, felis in hendrerit fermentum, eros metus egestas diam, sed venenatis turpis ante ut nunc. Suspendisse mattis nibh ut nisi. Nunc sodales libero id lacus. Suspendisse a odio. Morbi et felis vitae ante facilisis pretium. Duis dui mi, tempus vel, tristique sed, hendrerit sed, nisi. Curabitur ante metus, euismod at, suscipit sit amet, fermentum et, nulla. Suspendisse non quam. Aliquam erat volutpat. In est nisl, lobortis nec, euismod sit amet, accumsan ac, nisl. Ut feugiat nisi auctor augue tempus vestibulum. </p>
        						<p> Nam nec lacus. Nulla pellentesque bibendum magna. Integer fringilla facilisis massa. Praesent pulvinar urna sed dolor condimentum viverra. Nulla vel magna. Duis fermentum tortor eu nunc. Proin purus ipsum, elementum non, eleifend ac, condimentum ac, augue. Etiam sit amet quam. Mauris a dolor nec sem fringilla volutpat. Etiam porta, arcu vel tincidunt ultrices, tortor lorem pharetra massa, sit amet dignissim risus sapien nec turpis. </p>
        						<p> Phasellus id leo quis ligula vehicula laoreet. Nullam enim sapien, bibendum quis, laoreet sit amet, molestie sed, sapien. Fusce sit amet mi eu nisl placerat viverra. Integer non nisi non erat blandit adipiscing. Aliquam ac orci at purus rhoncus tincidunt. Donec sed mi non lorem tincidunt suscipit. Nam a mauris nec nibh varius porta. Sed luctus varius nibh. Nulla faucibus suscipit ipsum. Donec venenatis leo ac lorem. Vestibulum lobortis tempor nisi. Quisque vestibulum facilisis quam. Duis dictum mi nec nibh. Sed iaculis mi ac ante convallis imperdiet. Fusce mauris. Suspendisse aliquet lorem non turpis. Curabitur vel tellus sit amet metus suscipit consectetuer. Etiam a est eget tellus convallis sagittis. </p>
        						<p> Quisque elementum. Sed pede nunc, tincidunt quis, faucibus in, sollicitudin id, est. Cras consectetuer vehicula arcu. Phasellus sapien urna, hendrerit non, eleifend in, vehicula non, justo. Sed condimentum mi non libero. Integer sit amet lectus vel purus volutpat vulputate. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed lobortis ante a tortor. Aliquam consectetuer faucibus ipsum. Donec id neque. In hac habitasse platea dictumst. Pellentesque id risus. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; </p>
        					</div></td>
        			</tr>
        		</table>
        	</form>
        	<div id="border"></div>
        	<!--javascript call.......-->
        	<script type="text/javascript">setScrollXY(window.tester, '');</script>
        </div>
        <!--end #wrap-->
        </body>
        </html>
        I cleaned up the code a little bit.
        ||||If you are getting paid to do a job, don't ask for help on it!||||

        Comment


        • #5
          Thanks again for your response!

          Thanks again for your response!!

          Although that seems to work just fine when refreshing html pages, it seems to freeze all of my 'submit' buttons so that the user can't actually submit a response when the code is used with an .asp.


          The problem seems to lie within the use of:

          Code:
          function writeHidden(objFieldName)
          {
          objFieldName.value = test;
          return false;
          }

          Am I looking at this wrong?

          Comment


          • #6
            Okay get rid of the return false line.
            ||||If you are getting paid to do a job, don't ask for help on it!||||

            Comment


            • #7
              When I remove the "return false;" line, I get a page expiry warning in IE.

              Also noticed that Netscape is throwing up an "objDivName has no properties" error and that Firefox gives an "expected ':' but found ';'. Declaration dropped." error, both regardless of whether this line is omitted or not.

              Opera, on the other hand, works like a charm without the return statement!!


              Might this indicate a problem elsewhere in my code?

              Comment


              • #8
                Post your current code. The link would be best.
                ||||If you are getting paid to do a job, don't ask for help on it!||||

                Comment


                • #9
                  Ok, here's the main .asp - links, tags and everything.

                  The main difference from the actual HTML output is the 'Grid_Control' class, which sits inside the afforementioned scrollable div, and writes a simple table (no dynamically written script or anything like that).

                  Code:
                  <% @Language = "VBScript" %>
                  
                  	<% 	Option Explicit
                  		Response.Buffer = true
                  		Response.Expires = -1000
                  	
                  		const boolLive = False
                  	dim strURLFrag
                  
                  		if boolLive = True then
                  			strURLFrag = "../"
                  		else
                  			strURLFrag = "/mattyjim/"			
                  		end if
                  		
                  		
                  		
                  		
                  		
                  		dim intTOPFIELDS(2)
                  			intTOPFIELDS(0) = 1
                  			intTOPFIELDS(1) = 2
                  			intTOPFIELDS(2) = 3
                  			
                  	
                  		'--start page setup-----
                  			dim objGridDict
                  			dim objDivMem
                  			set objGridDict = CreateObject("Scripting.Dictionary")
                  			set objDivMem = CreateObject("Scripting.Dictionary")
                  		
                  		
                  				'--request handling code goes here-----
                  				if Request.Form <> "" then
                  					'--sets up a dictionary object to be used in comjunction with Javascript,
                  					'in order to remember and reset the scroll position of the grid div-----
                  					dim strItem
                  					for each strItem in Request.Form()
                  						if strItem = "DivMemoryText" then
                  							objDivMem("JavaMemory") = Request.Form(strItem)
                  						end if
                  					next
                  				end if
                  			
                  		'--end page setup-----
                  	
                  	%>
                  
                  
                  	<!--#include virtual="/mattyjim/lib/common/metatags.asp"-->
                  	<!--#include virtual="/mattyjim/lib/components/header_footer.asp"-->
                  	<!--#include virtual="/mattyjim/lib/components/controls.asp"-->
                  	<!--#include virtual="/mattyjim/lib/components/navigation.asp"-->
                  	
                  	
                  	<% call strict_tags() %>
                  
                  	<head>
                  		
                  	<title>Welcome to my website</title>
                  	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
                  
                  
                  	<link rel="stylesheet" href="<%=strURLFrag%>css/fonts.css" type="text/css" />
                  	<link rel="stylesheet" href="<%=strURLFrag%>css/layout.css" type="text/css" />
                  	<link rel="stylesheet" href="<%=strURLFrag%>css/content.css" type="text/css" />
                  	<link rel="stylesheet" href="<%=strURLFrag%>css/header_footer.css" type="text/css" />
                  	<link rel="stylesheet" href="<%=strURLFrag%>css/navigation.css" type="text/css" />
                  	
                  				<!--contains javascripts-->
                  	<!--#include virtual="/mattyjim/myScriptLib/javascripts.asp"-->
                  	
                  	</head>
                  					
                  		
                  		
                  	<body style="width: 1000px; margin-top: 2%; margin-left: auto; margin-right: auto; color: #000;">
                  		
                  			
                  		<div id="wrap" style="direction:ltr;"><!--start #wrap-->
                  				
                  		<% Call pageHeader("gate") %>
                  
                  						
                  		
                  		<form id="Gateway" name="Gateway" method="post" action="#" onSubmit="return writeHidden(Gateway.DivMemoryText)">
                  		
                  		<table id="myTable" name="myTable" class="table_stack" cellspacing="2" cellpadding="2" style="margin-left: 10%; margin-top: 20px; width: 80%; border: #6C9182 1px solid;">
                  			<tr>
                  				<td width="30%" style="border: #6C9182 1px solid; text-align: center;">
                  					
                  					<p>You must log in before you may sign the guestbook:</p>
                  					<p><label for="loginfield" style="display: block;">Login:</label>
                  					<input type="text" name="loginfield" id="loginfield" style="width: 80%;" /></p>
                  					<p><label for="passwordfield" style="display: block;">Password:</label>
                  					<input type="text" name="passwordfield" id="passwordfield" style="width: 80%;" /></p>
                  					<p>Your login and password details were provided on the business card attached to my CV</p>
                  					<p><img src="../pics/invader.gif" alt="You are not logged in!" / WIDTH="31" HEIGHT="25"></p>
                  					
                  				</td>
                  				<td>
                  					
                  							
                  					<!--javascript call.......-->
                  					<div id="tester" onscroll="writeScroll(this);" style="height: 400px; overflow: scroll; margin-right: 2%;">
                  						<input type="hidden" name="DivMemoryText" id="DivMemoryText" />	
                  										
                  					<table style="width: 100%;"><tr>
                  							<%	
                  													
                  							Dim strGridButtons(1)
                  								'el(1) mandatory for now
                  								strGridButtons(1) = "Row_Button_F1"	'row buttons - element numbers relate to column numbers.......
                  															
                  							
                  							
                  							Dim objGrid
                  								Set objGrid = new Grid_Control
                  																														
                  								objGrid.GetConnStrn = "DSN=DSN; uid=id; pwd=pwd"	'specify connection string			
                  								objGrid.GetDBInfo "master", "examples", "example_id"						
                  																														
                  																							
                  																														
                  								objGrid.ShowGridHeaders = True																
                  								objGrid.UseCheckButtons = False																
                  																														
                  								objGrid.CommaDelimStringBuilder = intTOPFIELDS	'make a string out of the column names	
                  																														
                  																														
                  								objGrid.GetGridButtons "Header_Button_F1", strGridButtons									
                  																														
                  																														
                  								objGrid.IsDrillDown = False																	
                  								objGrid.IsMultiColumn = True																	
                  								objGrid.Grid_control %>
                  						</tr></table>		
                  					</div>
                  				</td>
                  			</tr>
                  		</table>
                  		</form>
                  	<div id="border"></div>
                  
                  
                  	<!--javascript call.......-->
                  	<script type="text/javascript">setScrollXY(window.tester, '<%=objDivMem("JavaMemory")%>');</script>
                  
                  	
                  
                  <% call w3c_footer("gate") %>
                  
                  </div><!--end #wrap-->
                  
                  
                  
                  </body>
                  
                  
                  
                  </html>


                  I'm currently using the JavaScript code as an include .asp (I'm using Visual Interdev, which apparently doesn't recognise .js files). Here is the code:


                  Code:
                  <script type="text/javascript">
                  
                  var test;
                  
                  			function getScrollXY(passedVal)
                  			{
                  				var scrOfX = 0, scrOfY = 0;
                  					if( typeof( passedVal.pageYOffset ) == 'number' )
                  					{
                  					 //Netscape compliant
                  						scrOfY = passedVal.pageYOffset;
                  						scrOfX = passedVal.pageXOffset;
                  					} 
                  					else
                  					{
                  						if( passedVal && ( passedVal.scrollLeft || passedVal.scrollTop ) )
                  						{
                  							//DOM compliant
                  							scrOfY = passedVal.scrollTop;
                  							scrOfX = passedVal.scrollLeft;
                  						}
                  						else
                  						{
                  							if( passedVal.documentElement && ( passedVal.documentElement.scrollLeft || passedVal.documentElement.scrollTop ) )
                  							{
                  								//IE6 standards compliant mode
                  								scrOfY = passedVal.documentElement.scrollTop;
                  								scrOfX = passedVal.documentElement.scrollLeft;
                  							}
                  						}
                  					}
                  			return [ scrOfX, scrOfY ];
                  			}
                  			
                  		
                  		
                  		
                  		
                  			function setScrollXY(objDivName, strVBDictVar)
                  				{					
                  					if (strVBDictVar != "" && strVBDictVar != "undefined")
                  					{
                  						
                  						objDivName.scrollTop = strVBDictVar;
                  					}
                  				}
                  		
                  			
                  				
                  				function writeHidden(objFieldName)
                  				{
                  					objFieldName.value = test;
                  				}
                  	
                  	
                  				function writeScroll(val)
                  				{
                  					var retTest = new Array(2);
                  						retTest = getScrollXY(val)
                  						
                  						test = retTest[1];	
                  				}
                  
                  
                  
                  function writeHidden(objFieldName)
                  {
                  objFieldName.value = test;
                  //return false;
                  }
                  window.onload = function()
                  {
                  	writeHidden(document.getElementById('DivMemoryText'));
                  }		
                  
                  </script>

                  Comment


                  • #10
                    P.S: Almost forgot: the Grid_Control class outputs 'submit buttons' into the table - just in case this affects anything.

                    Comment


                    • #11
                      Change this
                      Code:
                      onSubmit="return writeHidden(Gateway.DivMemoryText)"
                      to this
                      Code:
                      onSubmit="writeHidden(document.getElementById('DivMemoryText'))"
                      You can probably get rid of this part now
                      Code:
                      window.onload = function()
                      {
                      	writeHidden(document.getElementById('DivMemoryText'));
                      }
                      Just be sure if you call the function the page has fully loaded.
                      ||||If you are getting paid to do a job, don't ask for help on it!||||

                      Comment


                      • #12
                        Still no joy, I'm afraid!


                        IE only works if I remove the 'action="#"' (gives the 'page expiry warning' otherwise), whilst Firefox and Netscape still give the old 'objDivName has no properties' error.

                        Opera seems to work just fine every time.

                        Comment


                        • #13
                          Wooohooooo!

                          Yay! Finally got it sorted!!

                          I removed the 'action="#"', replaced:

                          Code:
                          <script type="text/javascript">setScrollXY(window.tester, '<%=objDivMem("JavaMemory")%>');</script>

                          with:

                          Code:
                          <script type="text/javascript">setScrollXY("tester", '<%=objDivMem("JavaMemory")%>');</script>

                          ...and then referenced the div object with:

                          Code:
                          document.getElementById(objDivName).scrollTop = strVBDictVar;

                          ...where objDivName holds the "tester" string, rather than:

                          Code:
                          objDivName.scrollTop = strVBDictVar;

                          Just stood on your shoulders there, _Aerospace_Eng_; no way I would've cracked that without your help.

                          Thanks a lot!!!

                          Comment


                          • #14
                            P.s

                            Forgot to mention:

                            I used:

                            Code:
                            onSubmit="writeHidden(document.getElementById('DivMemoryText'));"

                            ...but left:

                            Code:
                            function writeHidden(objFieldName)
                            {
                            objFieldName.value = test;
                            return false;
                            }		
                            window.onload = function()
                            {
                            	writeHidden(document.getElementById('DivMemoryText'));
                            }
                            .......intact.

                            Comment

                            Working...
                            X