Click to See Complete Forum and Search --> : validation check


treble99
04-10-2003, 01:15 PM
Hi,

I have a what u will think as a very simple problem. I just want to create a validation on some form objects on an asp page to make sure they have been completed.

If they are completed then it inserts into the database if not a pop up message box appears saying which fields are empty with just an ok button. When ok is selected it just dissapears and lets the user carry on completing the form.

Below is the asp page with the form objects on:

<!--#include file="conn.asp"-->

<html>
<head>
<title>Add Technician</title>
</head>
<body>
<form name="aform" method="post" action="techadddata.asp">

Forename:
<input type="text" name="forename">
Surname:
<input type="text" name="surname">
Date Employed:
<input type="text" name="date_emp">

<input name="Submit" type="Submit" value="Add Technician"> <input type="reset" name="Submit2" value="Reset">

</form>

</body>
</html>

and the asp (techadddata.asp) page to add the data is:

<!--#include file="conn.asp"-->

<%

dim cmdAdd
dim strSQL

strSQL = "insert into TECHNICIAN (FORENAME, SURNAME, DATE_EMP) values (INITCAP('" & request.form("forename") & "'),INITCAP('" & request.form("surname") & "'),'" & request.form("date_emp") & "')"


set cmdAdd = server.createobject("adodb.command")

cmdAdd.CommandText = strSQL
cmdAdd.ActiveConnection = strConn

cmdAdd.Execute

set cmdAdd = nothing
%>

Could someone please tell me how to just check one box and display a message box and I can take it further from there. AT the minute im confused where to start.

treble99
04-10-2003, 06:36 PM
so how do i do it at the client end?