PDA

View Full Version : Display error in nested table


lmarshall
04-03-2003, 05:50 AM
My whole document is made up of two tables one table makes up the layout of the page. The other is a nested table that makes up the center (where the content goes) When it Validates the form the error shows up in a totally differnert column (right side of the table)

I have tryed my form validaion code in the heading and calling it from the body to get it in the content area and I have tried using including it in my content area. (Below)

<BODY>
<DIV AlIGN=CENTER>
<TABLE width=590 BoRDER=0 Cellpadding=0 cellspacing=0 colspacing=0>
<TR><TD COLSPAN=2 HEIGHT=50><img src="images/guest/basicdesign8_r1_c1.jpg" HEIGHT=100 WIDTH=750 ALT="Guest Title" BORDER=0></TD></TR>
<TR><TD HEIGHT=250 rowspan=2 bgcolor=#0099FF VALIGN=TOP><A HREF="rock.htm"><img name="Rock.gif" img src="Rock.gif" border=0 HEIGHT=60 WiDTH=133 ALT="Rock Button"><BR></A><A HREF="rap.htm"><img src="rap.gif" border=0 HEIGHT=60 WiDTH=133 ALT="Rap Button"></A><BR><A HREF="pop.htm"><img src="pop.gif" border=0 HEIGHT=60 WiDTH=133 ALT="Pop Button"></A><BR><A HREF="country.htm"><img src="country.gif" border=0 HEIGHT=60 WiDTH=133 ALT="Country Button"></A><BR><A HREF="altern.htm"><img src="altern.gif" border=0 HEIGHT=60 WiDTH=133 ALT="Alternative Button"></A></TD>
<TD COLSPAN=2 HEIGHT=200>
<!-- Content Table-->
<table width="100%" border="0">
<tr>
<td width="83%" ><DIV CLASS=GBFORM>Confirmation of Guest Book Entry</DIV></td>
<td width="17%"><center><input type="submit" OnClick="javascript:document.location.href('guestview.asp')" value="View Guest Book">
</center></td>
</tr>
<tr><td colspan=2><hr></td></tr>
<tr>
<td>
<%
'make sure name and message are filled in
if Request.Form("name") = "" OR Request.Form("mes") = "" then
Response.Write "<center><h1><font face='Arial, Helvetica, sans-serif' color='blue'>You must enter a name and a message</font></h1>"
Response.Write "<form>"
Response.Write "<input type='button' value=Retry onclick=history.back()>"
Response.Write "</form>"
Response.End
End If
%>
<% 'Declare the needed variables
Dim objRS, objConn, SQLStatement

'Creates the Recordset object that will hold the database records
Set objRS = Server.CreateObject("ADODB.Recordset")

'Creates a Connection object which allow you to connect to the database
Set objConn = Server.CreateObject("ADODB.Connection")

'Sets the neccesary connection information for the type of database
'driver, and where to locate the file (mappath)
objConn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & server.MapPath("/lmarshall/Project2") & "\" & "guest.mdb"

'Sets the SQL statement to retrieve all the guests
SQLStatement = "insert into guest(name, mail, btitle, bauthor, mes) values ('" & _
Request.Form("name") & "', '" & Request.Form("mail") & "', '" & Request.Form("btitle") & "', '" & Request.Form("bauthor") & "', '" & _
Request.Form("mes") & "')"
'Populates the recordset object with the query information
'in the SQL Statement
set objRS = objConn.Execute (SQLStatement)

'Error Handling - if there is an error, the process terminates
if err.number > 0 then

response.write "Error. Please contact the Webteam."
response.end
end if
%>
<center>
<SPAN CLASS=INFOTITLE><%=Request.Form("name")%>, thanks for filling out our guest book!<br>
You can see the information you entered below:</SPAN>
</center>
<br>
<FONT face="Arial, Helvetica, sans-serif"><B><I>Email: </B></I><%=Request.Form("mail")%><br><br>
<B><I>Favorite Author: </I></B><%=Request.Form("bauthor")%><br><br>
<B><I>Favorite Title: </I></B><%=Request.Form("btitle")%><br><br>
<B><I>Message: </I></B><br><%=Request.Form("mes")%></FONT>
</td>
</tr>
</table>
</TD>
<TR><TD VALIGN=BOTTOM HEIGHT=40><A HREF="guestform.asp"><img src="Guest2.jpg" border=0 HEIGHT=41 WIDTH=144 ALT="Guest Book"></A><A HREF="help.htm"><img src="Help.jpg" border=0 HEIGHT=41 WIDTH=141 ALT="Help Button"></A><A HREF="policy.htm"><img src="policy.jpg" border=0 HEIGHT=40 WIDTH=108 ALT="Policy Button"></A><A HREF="index.htm"><img src="home.jpg" border=0 HEIGHT=40 WIDTH=143 ALT="Home Button"></A></TD></TR>
<TR><TD width=23%></TD><TD width=110%></TD>
</TABLE>
</DIV>
</BODY>
</HTML>

How can I get my error info to show up in my content area of my table??

Thanks

ecnarongi
04-03-2003, 06:09 PM
You have two tables table A (the main table) and table B (the table inside table A), right? and the errors for table B are showing up to the right of table B inside the table A? Are the results for table B going to table B? Let me know.