PC Review


Reply
Thread Tools Rate Thread

DB, ASP, Email, Include: Catch-22

 
 
Michael Rothstein
Guest
Posts: n/a
 
      7th Jan 2004
I've got a few things I want to do on a form but combing them all seems to
be close to impossible using the default FrontPage 2002 components.

Here are the parameters:

1. I have a form when submitted sends us an email. No database storage is
necessary.

2. I'd like one form field (a drop down) to be populated from a database. I
know how to do this already and understand that the page must then be an ASP
which does not play well with the email submission in the previous parameter

3. If I can't populate the dropdown from a database due to the ASP/Mail
issue, I can create the single field as a separate page and include it on
the 30+ pages that use this dropdown. Although I've been told that I can
not include a form field within a form, manually adding the field name to
the "Saved Fields" will successfully submit the included page along with the
form. The problem is that when changes are saved to the page, the "Saved
Fields" reverts back to the default, which does not include my included form
field and I have to manually add the field again. I'm concerned that I'll
forget to correct the "Saved Fields" and that would cause extra work, not to
mention issues if we receive the emails without the contents of the form
field.

4. We have many forms that submit via email and we have scripts on the
backend that know how to handle the "Formatted Text" that FrontPage forms
generate. I know that there are other mail solutions, but I would rather not
have to deal with rewriting our scripts to handle the format of mail
generated by 3rd party mailers (if in fact they are different).

So basically, I need ASP to read the database, mail to submit or the ability
to turn off the regeneration of "Saved Fields" so I can use the include.
It's really unfortunate that you can't use ASP and mail together on a page.
FrontPage happly lets you do it and it's up to the user to realize that it
doesn't work. Besides all the explanations of ASP and form handlers (which
as an end user I'm not really interested in) is Microsoft going to make this
possible? Can you do it in FrontPage 2003? We're driving a little buggy
around on Mars. I don't think this is a lot to ask, is it?


 
Reply With Quote
 
 
 
 
Jim Buyens
Guest
Posts: n/a
 
      8th Jan 2004
As you state, FrontPage form handlers and ASP pages are
incompatible, and no, this isn't fixed in FP2003.

The usual approach in cases such as yours is simply to
send the mail using ASP or ASP.NET. Here's a
simple example using ASP:

<body>
<form method="POST">
<input type="text" name="txtBody" size="20"><p>
<input type="submit" value="Submit" name="btnSub"></p>
</form>
<%
Const cdoSchema = _
"http://schemas.microsoft.com/cdo/configuration/"
if request("btnSub") <> "" then
Set objMsg = CreateObject("CDO.Message")
objMsg.Subject = "Test " & now()
objMsg.Sender = "(E-Mail Removed)"
objMsg.To = "(E-Mail Removed)"
objMsg.TextBody = "The text box said, """ & _
request("txtBody") & """."
objMsg.Configuration.Fields.Item(cdoSchema & _
"sendusing") = 2
objMsg.Configuration.Fields.Item(cdoSchema & _
"smtpserver") = "snmp.crash8.com"
objMsg.Configuration.Fields.Item(cdoSchema & _
"smtpserverport") = 25
objMsg.Configuration.Fields.Update
objMsg.Send
end if
%>
</body>

Alternatively, perhaps you could write some JavaScript
code that would load your values into an empty drop-down
list. That way, the form field could be physically
present in each page, and a .js file could contain a
single copy of the script. For example:

<html>
<head>
<script language="javascript" src="loadtypes.js"></script>
</head>
<body onload="loadTypes();">
<form method="POST">
<p><select size="1" name="ddlType"></select></p>
<p><input type="submit" value="Submit" name="B1"></p>
</form>
</body>
</html>

where loadtypes.js contains:

function loadTypes(){
// Make sure drop-down box is empty.
while (document.forms[0].ddlType.options.length > 1 ){
document.forms[0].ddlType.options[1] = null;
}
// Load drop-down bos items.
document.forms[0].ddlType.options[0] =
new Option ("Animals", "a")
document.forms[0].ddlType.options[1] =
new Option ("Veggies", "v")
document.forms[0].ddlType.options[2] =
new Option ("Minerals", "m")
}

Jim Buyens
Microsoft FrontPage MVP
http://www.interlacken.com
Author of:
*----------------------------------------------------
|\---------------------------------------------------
|| Microsoft Office FrontPage 2003 Inside Out
||---------------------------------------------------
|| Web Database Development Step by Step .NET Edition
|| Microsoft FrontPage Version 2002 Inside Out
|| Faster Smarter Beginning Programming
|| (All from Microsoft Press)
|/---------------------------------------------------
*----------------------------------------------------


>-----Original Message-----
>I've got a few things I want to do on a form but combing

them all seems to
>be close to impossible using the default FrontPage 2002

components.
>
>Here are the parameters:
>
>1. I have a form when submitted sends us an email. No

database storage is
>necessary.
>
>2. I'd like one form field (a drop down) to be populated

from a database. I
>know how to do this already and understand that the page

must then be an ASP
>which does not play well with the email submission in

the previous parameter
>
>3. If I can't populate the dropdown from a database due

to the ASP/Mail
>issue, I can create the single field as a separate page

and include it on
>the 30+ pages that use this dropdown. Although I've

been told that I can
>not include a form field within a form, manually adding

the field name to
>the "Saved Fields" will successfully submit the included

page along with the
>form. The problem is that when changes are saved to the

page, the "Saved
>Fields" reverts back to the default, which does not

include my included form
>field and I have to manually add the field again. I'm

concerned that I'll
>forget to correct the "Saved Fields" and that would

cause extra work, not to
>mention issues if we receive the emails without the

contents of the form
>field.
>
>4. We have many forms that submit via email and we have

scripts on the
>backend that know how to handle the "Formatted Text"

that FrontPage forms
>generate. I know that there are other mail solutions,

but I would rather not
>have to deal with rewriting our scripts to handle the

format of mail
>generated by 3rd party mailers (if in fact they are

different).
>
>So basically, I need ASP to read the database, mail to

submit or the ability
>to turn off the regeneration of "Saved Fields" so I can

use the include.
>It's really unfortunate that you can't use ASP and mail

together on a page.
>FrontPage happly lets you do it and it's up to the user

to realize that it
>doesn't work. Besides all the explanations of ASP and

form handlers (which
>as an end user I'm not really interested in) is

Microsoft going to make this
>possible? Can you do it in FrontPage 2003? We're

driving a little buggy
>around on Mars. I don't think this is a lot to ask, is

it?
>
>
>.
>

 
Reply With Quote
 
Kevin Spencer
Guest
Posts: n/a
 
      8th Jan 2004
You can do anything you want with FrontPage and ASP. What you CAN'T do is do
anything you want with the wizards and other GUI tools that FrontPage
provides. Microsoft has built in a number of components that can do the most
common/typical things that are done with web pages, forms, and databases.
Those most common/typical things comprise about 1% of the possible
combinations of things that one can do with a web application.

You have a couple of choices here. Learn to program ASP and write your own
web application using FrontPage (you can actually write ASP code in Notepad
if you wish - FrontPage just makes it faster, by handling the HTML portion).
You can hire someone who can write ASP code to write your app for you. Or,
you can change your requirements. The only thing you CAN'T do is expect
Microsoft to have a wizard available for every possible functionality you
can imagine.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Michael Rothstein" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I've got a few things I want to do on a form but combing them all seems to
> be close to impossible using the default FrontPage 2002 components.
>
> Here are the parameters:
>
> 1. I have a form when submitted sends us an email. No database storage is
> necessary.
>
> 2. I'd like one form field (a drop down) to be populated from a database.

I
> know how to do this already and understand that the page must then be an

ASP
> which does not play well with the email submission in the previous

parameter
>
> 3. If I can't populate the dropdown from a database due to the ASP/Mail
> issue, I can create the single field as a separate page and include it on
> the 30+ pages that use this dropdown. Although I've been told that I can
> not include a form field within a form, manually adding the field name to
> the "Saved Fields" will successfully submit the included page along with

the
> form. The problem is that when changes are saved to the page, the "Saved
> Fields" reverts back to the default, which does not include my included

form
> field and I have to manually add the field again. I'm concerned that I'll
> forget to correct the "Saved Fields" and that would cause extra work, not

to
> mention issues if we receive the emails without the contents of the form
> field.
>
> 4. We have many forms that submit via email and we have scripts on the
> backend that know how to handle the "Formatted Text" that FrontPage forms
> generate. I know that there are other mail solutions, but I would rather

not
> have to deal with rewriting our scripts to handle the format of mail
> generated by 3rd party mailers (if in fact they are different).
>
> So basically, I need ASP to read the database, mail to submit or the

ability
> to turn off the regeneration of "Saved Fields" so I can use the include.
> It's really unfortunate that you can't use ASP and mail together on a

page.
> FrontPage happly lets you do it and it's up to the user to realize that it
> doesn't work. Besides all the explanations of ASP and form handlers

(which
> as an end user I'm not really interested in) is Microsoft going to make

this
> possible? Can you do it in FrontPage 2003? We're driving a little buggy
> around on Mars. I don't think this is a lot to ask, is it?
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Forward Email to include Senders email address in the body LDMueller Microsoft Outlook VBA Programming 0 20th May 2010 01:21 PM
how do I catch a bad email address before sending? Keith G Hicks Microsoft ASP .NET 1 28th Apr 2008 05:59 PM
Catch sent email with outlook Patrick Parent Microsoft VB .NET 1 5th Nov 2007 11:25 AM
automatically include email address when composing an email =?Utf-8?B?UklDSA==?= Windows Vista Mail 3 19th Jun 2007 09:17 PM
Include original email addres when forwarding to another email add =?Utf-8?B?dGhlcnlubw==?= Microsoft Outlook Discussion 1 11th Apr 2007 04:53 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:57 AM.