Running Bear
06-16-2003, 12:09 PM
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: ''
<%@ 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> </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!!
Cheers Al
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: ''
<%@ 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> </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!!
Cheers Al