[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

=?Utf-8?B?cm9kY2hhcg==?=

4/23/2004 8:49:00 PM

Front Page 2000, text box validation. I have a non
required email form field, but if the user puts their
email address in it, I want the field validated to make
sure it contains our company's domain (@mycompany.com). I
tried a java script but that didn't seem to work as I'm
using asp/cdonts for the form handler.

Thank you in advance
1 Answer

Jim Buyens

4/25/2004 5:09:00 AM

0

>-----Original Message-----
>Front Page 2000, text box validation. I have a non
>required email form field, but if the user puts their
>email address in it, I want the field validated to make
>sure it contains our company's domain (@mycompany.com).
>I tried a java script but that didn't seem to work as
>I'm using asp/cdonts for the form handler.

I would code:

<%
const myco = "@mycompany.com"
dim errmsg

errmsg = ""
if request("email") <> "" then
if lcase(right(request("email"),12)) <> myco then
errmsg = "E-mail doesn't end in " & myco
end if
end if

if errmsg = "" then
' code to send mail goes here
end if
%>

<p class=err><%=errmsg%></p>

where err refers to a style like the following in a
linked style sheet:

..err {font-weight: bold; color: #990000; }

Jim Buyens
Microsoft FrontPage MVP
http://www.inter...
Author of:
*----------------------------------------------------
|\---------------------------------------------------
|| Microsoft Office FrontPage 2003 Inside Out
||---------------------------------------------------
|| Web Database Development Step by Step .NET Edition
|| Microsoft FrontPage Version 2002 Inside Out
|| Faster Smarter Beginning Programming
|| (All from Microsoft Press)
|/---------------------------------------------------
*----------------------------------------------------