|
-
Jun 16th, 2003, 05:02 AM
#1
Thread Starter
Fanatic Member
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> </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.
-
Jun 16th, 2003, 09:27 AM
#2
Hyperactive Member
You cannot use ASP in this way, ASP is server side only which means you have no access to the client browser(apart from limited information which it passes to the server whn requesting a page). The only way ASP can interact with the client browser is when the user allows it to by sending information to the server. Once you process that information and send it back to the browser you cannot do anything else with it.
--
Anglo Saxon
-
Jun 16th, 2003, 09:30 AM
#3
Thread Starter
Fanatic Member
Anglo,
Thanks for that, I'll change it to use javascript on the client.
Cheers
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|