submit a form from an email...

Discussion in 'ASP General' started by cynth-, Dec 10, 2003.

  1. cynth-

    cynth- Guest

    Greetings!

    I am successfully generating an HTML-formatted email using ASP and a
    NewMail object. It works great. The content of the email includes a
    simple HTML form that posts to an asp page.

    THE PROBLEM:
    The form in the email functions properly (can be submitted, opens a
    browser and redirects to the "post-to" asp page) but the form data is
    not making it. i.e.....

    at the far end in the "post-to" asp page....
    request.form("someField") is empty

    I imagine it has to do with encryption but can't find any info on the
    subject. Any thoughts are greatly appreciated.

    Thank you kindly,
    Cynthia-
     
    cynth-, Dec 10, 2003
    #1
    1. Advertising

  2. cynth-

    Roland Hall Guest

    "cynth-"wrote:
    > Greetings!


    Howdy!

    > THE PROBLEM:
    > The form in the email functions properly (can be submitted, opens a
    > browser and redirects to the "post-to" asp page) but the form data is
    > not making it. i.e.....
    >
    > at the far end in the "post-to" asp page....
    > request.form("someField") is empty
    >
    > I imagine it has to do with encryption but can't find any info on the
    > subject. Any thoughts are greatly appreciated.



    If you have enctype= something then take it out. enctype="text/plain" would
    be used if you're action is action=mailto: Also, hopefully
    you mean method="post" and not method="post-to".

    This is all you need:
    <form id="aspform" name="aspform"
    action="http://mydomain.com/asp/myformresults.asp" method="post">

    ....unless you're validating input then you would change it to something
    like:

    <script type="text/javascript">
    function validate() {
    var iname=document.getElementById("yourname");
    if(!iname.value) {
    alert("Please type in your name");
    iname.focus();
    return false;
    } else {
    document.aspform.action="http://mydomain.com/asp/myformresults.asp";
    document.aspform.submit();
    return true;
    }
    }
    </script>

    <form id="aspform" name="aspform" method="post" onSubmit="return
    validate()">
    <input id="yourname" name="yourname" type="text" value="" />

    --
    Roland

    This information is distributed in the hope that it will be useful, but
    without any warranty; without even the implied warranty of merchantability
    or fitness for a particular purpose.
     
    Roland Hall, Dec 10, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.

Share This Page