Does this look ok??

wxdqz

New Member
Hi,

I've got a form which basically requires some comments boxes
to be filled in. The user isn't going to be forced and can submit without filling them in, hence gettting an Ok/Cancel box. Its more a prompt saying 'Hi, can u take a little more time to do these, but if not we don't mind'. It then focuses on the empty field.

Problem being is that it won't work! It keeps asking me to put ')' in weird places, like before the c in 'if (11comm.value.... Which is a really weird place. I'm guessing it means there is a problem further up the code. If I comment out the 11comm bit, it jumps down to the next bit, 21comm

I've pasted the whole code from the top of the page to the end of the javascript...the if (11comm... bit is quite far down

Can anyone cast any light on this annoying little error as its driving me nuts and has worked on other pieces of code I've used.

<%
Response.Cookies("SurveyCompleted") = CStr(Now)
Response.Cookies("SurveyCompleted").Expires = "May 1, 2003"
%>
<!-- #include file="adovbs.inc" -->
<%
' *** Begin DB Setup ***
dim conn
set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open Server.Mappath ("feedback.mdb")
set rs=Server.CreateObject("ADODB.recordset")
rs.Open "answersmarapr", conn,3,3


Const DATE_DELIMITER = "#"
' *** End DB Setup ***

Dim cnnFormToDB ' CONN object
Dim lngRecsAffected ' # of records affected... just informational
Dim strTextField ' text field
Dim intIntegerField ' integer field
Dim datDateTimeField ' date field

Dim strErrorMsg ' Holds error message if we catch any problems.


If Request.Form("action") <> "Save Form Data" Then

%>
<html>
<head>
<script language="javascript">
function checkup(theForm) {
with (theForm) {
if (11comm.value = "" ) {
if (!confirm("You have not completed all the answers. If you want to continue regardless, press OK else cancel to answer the missed questions.")) {
11comm.focus();
return false;
}
}
if ('21comm.value' = "" ) {
if (!confirm("You have not completed all the answers. If you want to continue regardless, press OK else cancel to answer the missed questions.")) {
21comm.focus();
return false;
}
}
if (31comm.value = "" ) {
if (!confirm("You have not completed all the answers. If you want to continue regardless, press OK else cancel to answer the missed questions.")) {
31comm.focus();
return false;
}
}
}
if (stumail.value = "" ) {
if (!confirm("You have not completed all the answers. If you want to continue regardless, press OK else cancel to answer the missed questions.")) {
stumail.focus();
return false;
}
}
}
return true;
}
</script>

Cheers,

Neil.:p
 
Back
Top