PDA

Click to See Complete Forum and Search --> : Object Expected Error


itsnaveen
Dec 8th, 2000, 07:39 PM
I am trying to run this code below but i get a runtime error
(ie) Object Expected Error
Can somebody tell me what is the problem in the code

<%@ Language=VBScript %>
<HTML>
<HEAD>
<link rel="home" href=http://www.egain.com>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</HEAD>
<BODY>
<form name="userinfo" action="chap3RequestObj.asp" method="post">
<center>
Fill the Form
Name:<input type="text" name="name"> <br>
Email:<input type="text" name="email"> <br>

<input type=reset value=Reset>
<input type=submit value=Submit onclick="too()">
<P>&nbsp;</P>
</form>
<%
sub too()
alert(Request.Form("name"))
end sub
%>
Name:<%=Request.Form("name") %> <br>
EMail:<%=Request.Form("email") %>
</BODY>
</HTML>

monte96
Dec 9th, 2000, 09:16 PM
Your trying to call server side code from the client side try this instead:


<%@ Language=VBScript %>
<HTML>
<HEAD>
<link rel="home" href=http://www.egain.com>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<SCRIPT Language=VBScript>
Sub too
window.alert(Request.Form("name"))
End Sub
</SCRIPT>
</HEAD>
<BODY>
<form name="userinfo" action="chap3RequestObj.asp" method="post">
<center>
Fill the Form
Name:<input type="text" name="name"> <br>
Email:<input type="text" name="email"> <br>

<input type=reset value=Reset>
<input type=submit value=Submit onclick="too">
<P>&nbsp;</P>
</form>
Name:<%=Request.Form("name") %> <br>
EMail:<%=Request.Form("email") %>
</BODY>
</HTML>