I'm back.
I made a page in my web to save form results to an Access database
instead of to a .csv file. I also made a page to display the contents
of the database after the forms are submitted.
It all works, and I'm pretty happy with it. If, however, that was the
end of the story I probably wouldn't be writing this, eh?
Here's my new challenge. When I used FP to make my original form (the
one that sent results to a .csv file) I wasn't happy with the form
validation available to me, so after much messing around I found a
JavaScript that started to do what I wanted. I don't know exactly how,
but I got FP to publish the site such that the script actually executed
before the form was submitted. What with all the ---webbot--- stuff
going on I don't know why it works, but it does.
When I copied this page (and gave it a .asp extension) and modified it
to use a form to hold results, I didn't change anything else, at least
not intentionally, but now the validation script does *not* run before
the form is submitted.
Here is the first part of the form code from the page that does work.
The function I want to run, which is in an external javascript file that
is linked in both pages, is called ValidateContactForm.
+++
<form method="POST" action="--WEBBOT-SELF--" name="ContactForm"
onSubmit="location.href='_derived/nortbots.htm';return false;"
webbot-onSubmit="return ValidateContactForm(); " onClick="return
checksubmit(this)">
<!--webbot bot="SaveResults" U-File="_private/contacts.csv"
S-Format="TEXT/CSV" S-Label-Fields="TRUE" startspan
B-Reverse-Chronology="FALSE" S-Date-Format="%m/%d/%y"
S-Time-Format="%I:%M %p" S-Builtin-Fields="REMOTE_NAME HTTP_USER_AGENT
Date Time" U-Confirmation-Url="registration_confirmation.htm"
B-Email-Label-Fields="TRUE" B-Email-Subject-From-Field="FALSE"
S-Email-Subject="Contact Form Submission" --><input TYPE="hidden"
NAME="VTI-GROUP" VALUE="0"><!--webbot bot="SaveResults" endspan
i-checksum="43374" -->
+++
Here is the equivalent code from the page that does *not* work:
<form method="POST" onSubmit="return ValidateContactForm();
"action="--WEBBOT-SELF--" name="ContactFormDB" onClick="return
checksubmit(this)">
<!--webbot bot="SaveDatabase" startspan
S-Builtin-Fields="HTTP_USER_AGENT REMOTE_HOST Timestamp REMOTE_USER"
SuggestedExt="asp" S-DataConnection="contact_dev"
S-RecordSource="Results" U-Database-URL="../fpdb/contact_dev.mdb"
S-Builtin-DBFields="Browser_type Remote_computer_name Timestamp
User_name" S-Form-Fields="Address1 Address2 AreaCode County City Email
Phone FirstName ZIPCode LastName State" S-Form-DBFields="Address1
Address2 AreaCode County City Email Phone FirstName ZIPCode LastName
State" U-ASP-Include-Url="../_fpclass/fpdbform.inc" --><input
TYPE="hidden" NAME="VTI-GROUP" VALUE="0"><!--#include
file="../_fpclass/fpdbform.inc"--><!--webbot bot="SaveDatabase" endspan
i-checksum="34604" -->
+++
The obvious difference is that in the page that does work FP prepended
"webbot-" before the onSubmit function. I tried to do the same thing in
Code View on the other page, but it didn't help.
Of course, if I view the source in the actual pages it doesn't look
anything like this because of way FP publishes. I could show that, too,
but wonder if anybody is still reading this.
Comments welcome!
Randy Morgan