Results 1 to 3 of 3

Thread: Object Required Error? - **** Resolved ****

Threaded View

  1. #1

    Thread Starter
    Fanatic Member aconybeare's Avatar
    Join Date
    Oct 2001
    Location
    UK
    Posts
    772

    Object Required Error? - **** Resolved ****

    Hello,

    I'm trying to submit a form without using a button, I'm getting an object required error when referencing window and document? Does anyone know why? I thought they were built in objects?

    these are the three errors I've been getting -
    Object required: 'window'
    Object required: 'document'
    Object required: ''


    Code:
    <%@ Language=VBScript %>
    <% 
    Dim UID
    Dim PWD
    
    If Len(Request.Form("txtUID")) Then 
    	ProcessPWD()
    End If
    
    Function ProcessPwd()
    Dim rtnCode
    Dim theFrm 
    
    Set theFrm = window.document.form1
    'Set theFrm = document.form1
    
    
    UID = Request.Form("txtUID")
    PWD = Request.Form("txtPwd")
    
    If (UID = "calvin") And (PWD = "hobbes") Then
    	rtnCode = 1
    Else
    	rtnCode = 0
    End If
    
    	Select Case rtnCode
    		Case 1 ' Login OK
    			theFrm.Submit
    		
    		Case Else ' Login Fail
    			Response.Write("<p>Login Attempt failed please try again" & vbcrlf)
    			Response.Write("</p>" & vbcrlf)
    	End Select
    
    End Function
    %>
    <html>
    <head>
    <meta NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
    </head>
    <body>
    <p>&nbsp;</p>
    <!-- The Auto Submit form -->
    <form name="form1" id="form1" action="../autoSubmit/changed.htm" method="post">
    	<input type="hidden" name="txtUID" id="txtUID" value="<%=UID%>">
    	<input type="hidden" name="txtPwd" id="txtPwd" value="<%=Pwd%>">
    </form>
    </body>
    </html>
    Any help will be appreciated!!
    Last edited by aconybeare; Jun 16th, 2003 at 09:31 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width