Email form data AND post to a page

Ask a Question related to Coldfusion - Getting Started, Design and Development.

  1. #1

    Default Email form data AND post to a page

    Newbie here...

    Can anyone help me? I am able to email form data successfully via CFmail upon
    submit. I am able to post the data to a page after submitting via CFoutput. But
    how can I do BOTH, email the data and post to a page upon submit?

    jgaluska Guest

  2. Similar Questions and Discussions

    1. redirect but with post data - mimick form post behaviour
      Any thoughts on how to mimic result of submitting form data via POST Method? I have some code that sanitizes some submitted formfields and i'd like...
    2. Can a asp page post data to another asp page inside frameset?
      I know this is probably easy but here is the details. I have an asp page that is not inside a frameset. I want to post data to another asp page...
    3. How to post some data in form of POST action of forms in asp?
      Hi there, I need to post some information into an ASP page (mypage.asp), in form of POST action which I do with the following code: 'contents...
    4. #24013 [Com]: Missing Form Post Data
      ID: 24013 Comment by: michael dot lindner at gmlindner dot de Reported By: webmaster at dtshowtime dot lu dot eu dot org...
    5. form data will not post
      can anyone be so kind as to look at http://www.mysolution.ws/HYPOCRITE.php and let me know why it isn't passing the form data to ...
  3. #2

    Default Re: Email form data AND post to a page

    Originally posted by: jgaluska
    I am able to post the data to a page after submitting via CFoutput. But how
    can I do BOTH, email the data and post to a page upon submit?


    Hi jgaluska,

    It is unclear what you mean here by "submitting via CFoutput" and "post to a
    page upon submit". You cannot submit a form using CFOUTPUT. Perhaps you mean
    something else?

    Are you trying to ..?

    A) Have a user fill out a form
    B) Submit the form information
    C) Email the form information somewhere
    D) Display a confirmation of the form information on the screen

    ... or something else?


    mxstu Guest

  4. #3

    Default Re: Email form data AND post to a page

    A, B, C and D! That's exactly what I'm trying to do! I don't know how to make C
    AND D both happen. I can email the information somewhere and I can display the
    information but I need to do both.

    Thank you for replying!]

    jgaluska Guest

  5. #4

    Default Re: Email form data AND post to a page

    Hello mxstu,

    I figured out something that works. It required three items:

    1. an HTML form: theForm.htm

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>The Form</title>
    </head>

    <body>
    <form action = "theAction.cfm" method = "post" name="form" id="form">
    <p>
    Email Address:
    <input name="ContactEmail" type="text" id="ContactEmail" />
    </p>
    <p>
    Some Stuff:
    <input type = "text" name = "value1">
    </p>
    <p> <input type = "submit" value = "Submit">
    </p>
    </form>
    </body>
    </html>

    2. A CFOUTPUT of the form: theOutput.cfm

    <title>The Output</title><table>
    <tr>
    <td width="260">
    <CFOUTPUT>
    <p>Email Address: #ContactEmail#</p>
    <p>Some Stuff: #value1#
    </p>
    </CFOUTPUT>
    </td>
    </tr>
    </table>

    3. An action page to both display the output and email the form: theAction.cfm

    <cfmail from="#form.ContactEmail#"
    to="email@email.net"
    subject="The Form"
    server="mail.server.com"
    type="HTML">

    <cfinclude template="theOutput.cfm">

    </cfmail>
    <table>
    <tr>
    <td width="261">
    <CFOUTPUT>
    <p>Email Address: #ContactEmail#</p>
    <p>Some Stuff: #value1#
    </p>
    </CFOUTPUT>
    </td>
    </tr>
    </table>

    This worked for me, but if you have any comments or a better way, I'd
    appreciate hearing from you. If not, thank you again for responding.

    Joe G

    jgaluska Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139