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. 4 1391
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" <mi********@htomail.com> wrote in message
news:e7**************@TK2MSFTNGP15.phx.gbl... 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.
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" <so*******@in-time.invalid> wrote in message
news:eg*************@TK2MSFTNGP14.phx.gbl... 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" <mi********@htomail.com> wrote in message news:e7**************@TK2MSFTNGP15.phx.gbl... 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.
I was never one for complicating things (brain farts excluded of course
<g>)...
.... and your welcome ;o)
--
Regards
Steven Burn
Ur I.T. Mate Group www.it-mate.co.uk
Keeping it FREE!
"middletree" <mi********@htomail.com> wrote in message
news:#Q**************@tk2msftngp13.phx.gbl... 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" <so*******@in-time.invalid> wrote in message news:eg*************@TK2MSFTNGP14.phx.gbl... 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" <mi********@htomail.com> wrote in message news:e7**************@TK2MSFTNGP15.phx.gbl... 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.
Gazing into my crystal ball I observed "middletree"
<mi********@htomail.com> writing in
news:#Q**************@tk2msftngp13.phx.gbl: 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!
You might like some of the stuff at http://www.intraproducts.com/beta/requiredform.asp , does some other server
side validation and has a good way to display errors to the client.
"Steven Burn" <so*******@in-time.invalid> wrote in message news:eg*************@TK2MSFTNGP14.phx.gbl... 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" <mi********@htomail.com> wrote in message news:e7**************@TK2MSFTNGP15.phx.gbl... > 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. > >
--
Adrienne Boswell http://www.cavalcade-of-coding.info
Please respond to the group so others can share This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Fortepianissimo |
last post by:
Here is the situation: I want my server started up upon connection.
When the first connection comes in, the server is not running. The
client realizes the fact, and then starts up the server and...
|
by: Phil |
last post by:
I am using a Pascal like language (Wealth-Lab) on W2K and call this server:
class HelloWorld:
_reg_clsid_ = "{4E797C6A-5969-402F-8101-9C95453CF8F6}"
_reg_desc_ = "Python Test COM Server"...
|
by: Bennett Haselton |
last post by:
I want to get an ASP.Net hosting account with my ISP, and I'm trying
to find out what level of access to the server is requried in order
for me to view the server in Server Explorer in Visual...
|
by: EP |
last post by:
When running my asp.net hosting service (asp.net without IIS), on server
2003 with IIS not installed, I get the following when trying to process a
request.
"System.DllNotFoundException: Unable to...
|
by: Mike |
last post by:
Hi,
I am strugling with a simple problem which I can't seem to resolve.
I have an asp.net page which contains a server-control (flytreeview,
which is a kind
of a tree to be exact).
The tree is...
| |
by: coosa |
last post by:
Hi,
I was installing SQL Server on my machine and during installation my PC
freezed. It happens frequently on my machine. So i tried after
restarting to install it again and since then i always...
|
by: sara |
last post by:
Hi All,
I was able to connect to MS SQL Server 2005 on my computer but after a
while I can not. When I want to connect to it using MS SQL Server
Management Studio I got this error:
An error...
|
by: manish deshpande |
last post by:
Hi,
When i'm installing MySQL-server-standard-5.0.24a-0.rhel3.i386.rpm by the following command:
rpm -i MySQL-server-standard-5.0.24a-0.rhel3.i386.rpm the following error is being shown:
...
|
by: Developer |
last post by:
Hello All,
i have recently installed VS2005 and was trying to install SQL sever
2000.
I have Win XP' SP2. But when I tried installing, it only installed
client tools and not the database.
Can...
|
by: Lee T. Hawkins |
last post by:
I am having a number of problems over the last two full days trying to get
an ASP.NET 2.0 application to connect to a SQL Server 2005 database...
First off, I built this application w/ Visual...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
| |
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |