OK, this is a good answer. It comes from a completely different direction
from what I was thinking. I was thinking I'd have to come up with code which
read the SQL Server error after it had been generated and displayed my
customer message instead of the SQL/ASP error. Your solution captures the
problem before it gets that far. I like this. I see where it will take some
work to capture all the other parts of the form and put them back into
place, but it will be worth doing.
thanks very much!
"Steven Burn" <> wrote in message
news:...
> sTemp = Request.Form("txtaSomeTextArea")
> If Len(sTemp) > 1000 Then
> Response.Redirect "/?err=1&tmp=" & sTemp
> End If
>
> '// Example form
> <%
> If Request.Querystring("err") <> "" Then Response.Write "Error: Too
many
> characters<br><br>"
> %>
> <form action="thispage.asp" name="frmTemp">
> <textarea name="txtaSomeTextArea"><%if len(request.querystring("tmp") > 0
> Then%><%=request.querystring("tmp")%><%end if%></textarea>
> <input type="submit" name="btnSubmit">
> </form>
>
> --
> Regards
>
> Steven Burn
> Ur I.T. Mate Group
> www.it-mate.co.uk
>
> Keeping it FREE!
>
> "middletree" <> wrote in message
> news:...
> > I posted this yesterday afternoon, but for some reason, I don't see it
in
> my
> > newsreader, on either of my 2 computers. So I am re-posting.
> >
> >
> > I'd like to see if there is any guidance in the form of sample code or a
> > tutorial for server-side validation. Specifically for the thing I am
> trying
> > to do, if a user types too many letters into Textarea, then they see an
> > error on the screen. I was able to catch most occurrences of this error
> with
> > client-side javascript. However, I'd like to handle it server-side in
> order
> > to catch those cases that get by the javascript for whatever reason. If
I
> > could just catch the error before it gets displayed, then display a
> warning
> > in red letters in a pretty format, then that's all I'm hoping to do.
> >
> > I went to ASPFAQ.com, didn't find anything there. I also did a search of
> > this forum and didn't see anything. I know conceptually what I want to
> do,
> > but I am not sure how to go about it.
> >
> >
>
>