Alright,
I'm stuck again.
I'm not 100% sure how the 'submit' works on my form, or how it updates my database. As you see I create a connection to the database and execute an SQL string which updates the database. I have tried to put that code in a function and to call that function at the end of the validate method if the validate finds no errors.... however I haven't gotten this to work.
This is my insert statement:
<%
dim oConn
dim str
Set oConn = Server.CreateObject("ADODB.Connection"

oConn.Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("\bswiftly\db\Ranch.mdb"

)
str = "INSERT INTO tblRancher (FirstName, LastName, Notes)"
str = str & " VALUES ('" & Request.Form("fName"

&"','" & Request.Form("lName"

str = str & "','" & Request.Form("notes"

& "')"
oConn.Execute(str)
Response.redirect ("RancherAdded.asp"

%>
you said that you wanted me to put this code into the RancherAdded.asp page? Because this is the next form, I will still be able to access the fName, and "notes" properties through Request.Form right?
This is the code I have in my page so far, and It is validating and changing the images, but as soon as I hit OK on the alert box, it redirects ? ? ?
(I haven't been able to get it working with the "button" type, instead of the submit type either).
<HTML>
<HEAD>
<script language="JavaScript1.1">
function validateForm()
{
var errorFlag = false;
//Check our name input
if(frmUserInfo.fName.value.length == 0)
{
//show the IMG and set the flag
document.getElementById("txtfName_error"

.style.display='inline';
errorFlag = true;
}
if(frmUserInfo.lName.value.length == 0)
{
//show the IMG and set the flag
document.getElementById("txtlName_error"

.style.display='inline';
errorFlag = true;
}
if(errorFlag)
{
}
else
{
document.frmUserInfo.submit();
}
}
</script>
</HEAD>
<BODY>
<form method="POST" action="doAddRancher.asp" name="frmUserInfo" onSubmit="validateForm();">
<TABLE BORDER = "1">
<TR>
<TD align="right">
<span style='display:none;' id='txtfName_error'>
<IMG SRC= "images/warning.gif"></span>
</TD>
<TD>
First Name:
</TD>
<TD>
<input type="text" name="fName" size="20">
</TD>
</TR>
<TR>
<TD align="right">
<span style='display:none;' id='txtlName_error'>
<IMG SRC= "images/warning.gif"></span>
</TD>
<TD>
Last Name:
</TD>
<TD>
<input type="text" name="lName" size="20">
</TD>
</TR>
<TR>
<TD>
</TD>
<TD>
Notes:
</TD>
<TD>
<textarea rows="5" name="notes" cols="51"></textarea>
</TD>
</TR>
<TR>
<TD>
<input type="submit" value="Submit" name="submit">
</TD>
<TD>
<input type="reset" value="Reset" name="reset">
</TD>
</TR>
</TABLE>
</form>
</BODY>
</HEAD>