Getting a response to a specific table

I've got some validation on a form, the following is an example:

If surname.value = "" Then
Response.Write "Please enter a valid Surname"
Exit Sub
End If

If an error message is returned I want the response to appear in a specific table called 'error_response' and not just at the top of the page.

Could somebody show me some code that will do this

Regards,

Matt.

Matt_UnsworthAsked:
Who is Participating?
 
knightEknightConnect With a Mentor Commented:
dim errMsg
If surname.value = "" Then
 errMsg = "Please enter a valid Surname"
Exit Sub
End If

then in your table

<TABLE id='error_response'>
<TR><TD><%=errMsg%></TD></TR>
</TABLE>
0
 
knightEknightCommented:
actually, the dim errMsg statement must be outside the sub ...
0
 
Matt_UnsworthAuthor Commented:
Cheers,

Matt.
0
All Courses

From novice to tech pro — start learning today.