/    Sign up×
Community /Pin to ProfileBookmark

Does this look ok??

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

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@gil_davisMar 26.2003 — Perhaps you problem is that variable names and object names are not supposed to start with numbers.
Copy linkTweet thisAlerts:
@mcslemonauthorMar 26.2003 — ah!! That'll be why!!

Works now!

Cheers for your help!

Neil.
×

Success!

Help @mcslemon spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.20,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...