K
Kari Setälä
I'm using ASP VBScript. I have a feedback form that should do two things:
insert the contents into a database and send the contents as email. The
address it would be sent to varies - users select the company they want to
send the feedback to from a menubox. The problem is that I can't just type
the email addresses as "option values" since I need to save the company name
to a database. I don't want to save the email addresses. This would
otherwise solve my problem.
I know how to update the database, use CDONTS etc., but I need to find a way
to somehow change the email address the email is sent to depending on the
selection of the menu.
How about using 'OnChange' behavior for the menu and creating a script
function (called SaveEmail) which inserts the email address into a session
variable, depending on the selection? I've tried it, but I receive an error:
"SaveEmail is not defined".
For example:
<script runat="server" language="javascript">
function SaveEmail() {
if (document.form1.Company.value == "My Company")
{ Session("email")[email protected]";
}
etc...
}</script>
insert the contents into a database and send the contents as email. The
address it would be sent to varies - users select the company they want to
send the feedback to from a menubox. The problem is that I can't just type
the email addresses as "option values" since I need to save the company name
to a database. I don't want to save the email addresses. This would
otherwise solve my problem.
I know how to update the database, use CDONTS etc., but I need to find a way
to somehow change the email address the email is sent to depending on the
selection of the menu.
How about using 'OnChange' behavior for the menu and creating a script
function (called SaveEmail) which inserts the email address into a session
variable, depending on the selection? I've tried it, but I receive an error:
"SaveEmail is not defined".
For example:
<script runat="server" language="javascript">
function SaveEmail() {
if (document.form1.Company.value == "My Company")
{ Session("email")[email protected]";
}
etc...
}</script>