Wrox Programmer Forums
|
ASP Forms As of Oct 5, 2005, this forum is now locked. Please use "Classic ASP beginner" at http://p2p.wrox.com/forum.asp?FORUM_ID=54 or "Classic ASP Professional" http://p2p.wrox.com/forum.asp?FORUM_ID=56 instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP Forms section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 29th, 2004, 11:18 PM
Registered User
 
Join Date: Aug 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Problem with code

Hi guys

I'm having problems with the following error:

MS VBScript compilation (0x800A03F6) Expected End
/Samples/Access_mem/confirm.asp, line 143.

Pls help.

Here's the code




<%
Function ChkString(str)
        
        str = replace(str, "<", "&lt;", 1, -1, 1)
        str = replace(str, ">", "&gt;", 1, -1, 1)
    
     ChkString = str
End Function

name = trim(ChkString(Request.form("name")))
email = trim(ChkString(Request.form("email")))
telNo = trim(ChkString(Request.form("telno")))
mobNo = trim(ChkString(Request.form("mobno")))
address = trim(ChkString(Request.form("address")))
City = trim(ChkString(Request.form("city")))
Country = trim(ChkString(Request.form("country")))
code = trim(ChkString(Request.form("code")))
Password = trim(ChkString(Request.form("password")))
confirmpassword = trim(ChkString(request.form("confirmpassword")))


if name = "" then
Response.Write "Please Enter Your name<br>"
else

if email = "" then
Response.Write "Please Enter valid email<br>"
else

if telno = "" then
Response.Write "Please Enter your telephone number<br>"
else

if mobno = "" then
Response.Write "Please Enter your mobile number<br>"
else

if address = "" then
Response.Write "Please Enter valid Address<br>"
else

if city = "" then
Response.Write "Please Enter City<br>"
else


if country = "" then
Response.Write "Please select country<br>"
else

if code = "" then
Response.Write "Please Enter zip code<br>"
else


if password = "" then
Response.Write "Please Enter password<br>"
else

if password <> confirmpassword then
Response.Write "Password does not match"
else
%>


<P align=center><i><b>Please verify if all your info you supplied is correct! If
not hit back and correct.</b></i></P>



    <center>
    <table border="1" cellpadding="2" cellspacing="3" width="400">
    
     <tr>
        <td >Name :</td>
        <td ><%=name%>&nbsp;</td>
     </tr>
     <tr>
        <td >E-mail :</td>
        <td ><%=email%>&nbsp;</td>
     </tr>

tr>
        <td >telno :</td>
        <td ><%=telno%>&nbsp;</td>
     </tr>

tr>
        <td >mobno :</td>
        <td ><%=mobno%>&nbsp;</td>
     </tr>
     <tr>
        <td >address :</td>
        <td ><%=address%>&nbsp;</td>
     </tr>
     <tr>
        <td >city :</td>
        <td ><%=city%>&nbsp;</td>
     </tr>
    
            
        <tr>
        <td >country :</td>
        <td ><%=country%>&nbsp;</td>
     </tr>
    
        <tr>
        <td >code :</td>
        <td ><%=code%>&nbsp;</td>
     </tr>
    
    
     <tr>
        <td >Password :</td>
        <td ><%=password%>&nbsp;</td>
     </tr>
     <tr>
        <td ></td>
        <td >


        <form action=addnewmember.asp method="post">
        <input type=hidden name="name" value="<%=name%>">
        <input type=hidden name="email" value="<%=email%>">
        <input type=hidden name="telephone no" value="<%=telephoneno%>">
<input type=hidden name="mobno" value="<%=mobno%>">
         <input type=hidden name="address" value="<%=address%>">
         <input type=hidden name="city" value="<%=city%>">
            <input type=hidden name="country" value="<%=country%>">
             <input type=hidden name="zip" value="<%=zipcode%>">
    
        <input type=hidden name="password" value="<%=password%>">
        <input type=submit value="Confirm">
        </form>

        </td>
     </tr>
    
    </table>
    </center>


<%
end if
end if
end if
end if
end if
end if
end if
end if
end if



%>

Thkx
 
Old August 30th, 2004, 07:48 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hey,

You got 10 if statements checking the required fields, but only got 9 end ifs.

Brian
 
Old September 10th, 2004, 09:21 AM
Friend of Wrox
 
Join Date: Sep 2004
Posts: 104
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to sureshbabu Send a message via Yahoo to sureshbabu
Default

Hi,
    I beleive you have to use "else if" as a single word" like "elseif" , and noneed of 9 "end if" statements. At the end you need only one "End If" statement.
Try this
Suresh Babu





Similar Threads
Thread Thread Starter Forum Replies Last Post
problem with example code? j_nord BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 7 February 28th, 2007 04:03 PM
Code behind problem.. shabirmaher General .NET 1 August 12th, 2005 03:09 AM
problem in code HumaMunir BOOK: Beginning Java 2 3 May 16th, 2005 09:19 AM
Problem in Code about "SetValue" arctica82 Pro VB.NET 2002/2003 2 April 15th, 2005 03:39 PM
problem on example code zerocold C# 0 July 15th, 2004 04:19 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.