Home | Advertising Info9 USERS CURRENTLY ONLINE   
PowerASP
   Site Search Contact Us Friday, May 17, 2024  

  Active InfoActive Info  Display List of Info MembersMemberlist  Search The InfoSearch  HelpHelp
  RegisterRegister  LoginLogin
Classic ASP - General
 PowerASP Code Help Area : Classic ASP - General
Subject Info: How to check if required field are empty? A d d  -  P o s tAdd P o s t
Author
Message << Prev Info | Next Info >>
Stentec
Newbie
Newbie


Joined: March/04/2005
Location: Netherlands
Online Status: Offline
Info: 1
Added: March/04/2005 at 5:01am | IP Logged Quote Stentec

I have a form created that works good, what I want is to check if the required fields are filled or left blank and if so then let a visitor return to the form. I searched on the web but could only find a solution for CDONT.MAIL and i'm using SMTPsvg.Mailer on adivse of my host (windows 2000 server).
I'm totally new with asp so if someone could help out that would be great!

This is the script:


<html>

<head>
<title>Proefplaatsing formulier</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head>

<body background="bg_06.jpg" text="#FFFFFF" link="#FFFFFF" vlink="#FFFFFF" alink="#FFFFFF">
<basefont size="2" face="Verdana">

<h3><font face="Verdana, Arial, Helvetica, sans-serif">Aanvraag Proefplaatsing.</font></h3>
<%

Set Mailer = Server.CreateObject("SMTPsvg.Mailer")

'Extra property van AspQMail.
Mailer.QMessage = True

Mailer.FromName = "Proefplaatsingformulier"
Mailer.FromAddress = "info@....."

'Dit is als u bij ons dit component gebruikt
Mailer.RemoteHost = "localhost"

Mailer.AddRecipient "Proefplaatsing", "jonathan@technoise.nl"

 

'Onderwerpregel van het bericht
Mailer.Subject = "Proefplaatsing Aanvraag"

'Als u de Body van het bericht wil leeg maken na het versturen van de mail moet u
'Mailer.ClearBodyText gebruiken.
'Als u vbcrlf opneemt in de body krijg je op die plek een return.

Body = "Proefplaatsing Aanvraag" & vbcrlf
Body = Body & "bedrijf " & request.form("bedrijf") & vbcrlf
Body = Body & "adres " & request.form("adres") & vbcrlf
Body = Body & "postcodeplaats " & request.form("postcodeplaats") & vbcrlf
Body = Body & "werknemers " & request.form("werknemers") & vbcrlf
Body = Body & "contactpersoon " & request.form("contactpersoon") & vbcrlf
Body = Body & "telefoon " & request.form("telefoon") & vbcrlf
Body = Body & "email " & request.form("email") & vbcrlf
Body = Body & "gpe drx50 " & request.form("gpe drx50") & vbcrlf
Body = Body & "vendo 75 " & request.form("vendo 75") & vbcrlf
Body = Body & "vendo 544 " & request.form("vendo 544") & vbcrlf
Body = Body & "multi frisdrank " & request.form("multi frisdrank") & vbcrlf
Body = Body & "drf 15 " & request.form("drf 15") & vbcrlf
Body = Body & "drx 30 " & request.form("drx 30") & vbcrlf
Body = Body & "vendo 4000 " & request.form("vendo 4000") & vbcrlf
Body = Body & "fas 480 " & request.form("fas 480") & vbcrlf
Body = Body & "fas m everest " & request.form("fas m everest") & vbcrlf

Mailer.BodyText = Body

'timeout voor het versturen van de mail
Mailer.Timeout = 30


'Mailer.SendMail verstuurt de email en
'geeft True als het zenden gelukt is en
'False als dit niet zo is. Onderstaande
'code geeft meer informatie als het fout gaat.
if Mailer.SendMail then
    Response.Write "Uw aanvraag is verzonden, wij nemen z.s.m. contact met u op."
else
    Response.Write "Probleem met het versturen van aanvraag!<br>"
    Response.Write Mailer.Response
end if

%>
</body>
</html>

Back to Top View Stentec's Profile Search for other info by Stentec
 
mjunior
Newbie
Newbie
Avatar

Joined: November/06/2004
Location: Brazil
Online Status: Offline
Info: 27
Added: January/18/2006 at 8:01pm | IP Logged Quote mjunior

I know is late..but here it goes anyway..

Have you tried the Isempty or Isnull test?
Use it like this:
IsEmpty - retur True if the variable contains values: 0 or "", else, return False.

sintax: IsEmpty(variable)

<%
var1 = ""
var2 = 0
var3 = "powerasp"
response.write IsEmpty(var1) 'retorna true
response.write IsEmpty(var2) 'retorna true
response.write IsEmpty(var3) 'retorna false
%>

Sorry didn't answer befor but I only check the site when I have a new issue I need help..

__________________
mjunior(dumb)
Back to Top View mjunior's Profile Search for other info by mjunior
 

If you wish to make a comment to this info you must first login
If you are not already registered you must first register

  A d d  -  P o s tAdd P o s t
Printable version Printable version

Info Jump
You cannot add new info in this area
You cannot add to info in this area
You cannot delete your info in this area
You cannot edit your info in this area
You cannot create polls in this area
You cannot vote in polls in this area

   Active Server Pages Rule The World
Contact Us  
All artwork, design & content contained in this site are Copyright © 1998 - 2024 PowerASP.com and Christopher J. Williams
Banner ads ,other site logos, etc are copyright of their respective companies.
STATS Unless otherwise noted - All Rights Reserved.

Active Server Pages ASP ASP.NET .aspx .ascx Web HTML Developer Internet Microsoft Web Services Visual Studio .NET CJWSoft ASPProtect ASPBanner ASPClassifieds www.aspprotect.com, www.cjwsoft.com,www.aspclassifieds.com,www.aspphotogallery.com