Professional Web Applications Themes

Processing e-mail data from html-form - Macromedia ColdFusion

Hello all, We would like to process data from an html e-mailform (clientsurvey). For that purpose we have made a cfml-file who is sending an html e-mail to the clients e-mail address. After answering 6 short questions the client can click on the submit button; a cfml-file is opening in the browser for processing the form-data. We are receiving an error from that file that the form-elements are not defined? What are we doing wrong? Greetings, Rudy...

  1. #1

    Default Processing e-mail data from html-form

    Hello all,

    We would like to process data from an html e-mailform (clientsurvey).

    For that purpose we have made a cfml-file who is sending an html e-mail to the
    clients e-mail address. After answering 6 short questions the client can click
    on the submit button; a cfml-file is opening in the browser for processing the
    form-data. We are receiving an error from that file that the form-elements are
    not defined?

    What are we doing wrong?

    Greetings,
    Rudy

    alpenman Guest

  2. #2

    Default Re: Processing e-mail data from html-form

    At the very top of your form processing page, do this:
    <cfdump var = "#form#">

    Look at what you have and compare it to what you expected.

    Originally posted by: alpenman
    Hello all,

    We would like to process data from an html e-mailform (clientsurvey).

    For that purpose we have made a cfml-file who is sending an html e-mail to the
    clients e-mail address. After answering 6 short questions the client can click
    on the submit button; a cfml-file is opening in the browser for processing the
    form-data. We are receiving an error from that file that the form-elements are
    not defined?

    What are we doing wrong?

    Greetings,
    Rudy



    Dan Guest

  3. #3

    Default Re: Processing e-mail data from html-form

    Thanks for answering!

    I get "struct[empty]" on top of the screen... and I suppose thats not a good sign!
    alpenman Guest

  4. #4

    Default Re: Processing e-mail data from html-form

    Actually, it's useful. It tells you the form is not getting submitted to that
    page. Now, to figure out why not.

    I'm going to guess that on your form tag, you have action = "get" instead of
    action="post". Maybe I'm wrong, maybe I'm right.

    Please post your form tag, plus all the form fields. Also tell us the name of
    the file where you expected to see the form values and didn't.

    Dan Guest

  5. #5

    Default Re: Processing e-mail data from html-form

    The process has 2 files: one for sending the survey e-mail to the client and
    one for processing the survey.

    In the first file there is a cfform included in the cfmail tag (I have
    stripped the code):

    <cfloop query="survey1">
    <cfmail from="**.*"
    to="**"
    subject="*"
    type="html">

    <cfform name="survey1" action="http://www.r-ebus.be/***" method="post">
    YES <cfinput type="radio" name="question1" value="1" checked>
    NO <cfinput type="radio" name="question1" value="0">
    YES <cfinput type="radio" name="question2" value="1" checked>
    NO <cfinput type="radio" name="question2" value="0">
    <cfinput type="text" name="question3" size="80" maxlength="255"
    style="font-family: Arial; font-size:11 px">
    <textarea name="question4" rows="3" cols="82" style="font-family: Arial;
    font-size:11 px"></textarea>
    <textarea name="question5" rows="3" cols="82" style="font-family: Arial;
    font-size:11 px"></textarea>
    1000 ?/$ <cfinput type="radio" name="question6" value="1000" checked>
    5000 ?/$ <cfinput type="radio" name="question6" value="5000">
    10000 ?/$ <cfinput type="radio" name="question6" value="10000">
    more <cfinput type="radio" name="question6" value="999999">
    <input type="submit" value=" SEND " style="font-family: Arial; font-size:11
    px">
    </cfform>

    When the client clicks on the "SEND" button (in the e-mail) the second page
    opens in the browser:

    <cfoutput>
    <cfset Form.Date = DateFormat(now(), "YYYY/MM/DD")>
    <cfset Form.Question1 = #Form.Question1#>
    <cfset Form.Question2 = #Form.Question2#>
    <cfset Form.Question3 =
    #ReReplaceNoCase(Form.Question3,Chr(34),Chr(39),"A LL")#>
    <cfset Form.Question3 =
    #ReReplaceNoCase(Form.Question3,Chr(60),Chr(39),"A LL")#>
    <cfset Form.Question3 =
    #ReReplaceNoCase(Form.Question3,Chr(62),Chr(39),"A LL")#>
    <cfset Form.Question4 =
    #ReReplaceNoCase(Form.Question4,Chr(34),Chr(39),"A LL")#>
    <cfset Form.Question4 =
    #ReReplaceNoCase(Form.Question4,Chr(60),Chr(39),"A LL")#>
    <cfset Form.Question4 =
    #ReReplaceNoCase(Form.Question4,Chr(62),Chr(39),"A LL")#>
    <cfset Form.Question5 =
    #ReReplaceNoCase(Form.Question5,Chr(34),Chr(39),"A LL")#>
    <cfset Form.Question5 =
    #ReReplaceNoCase(Form.Question5,Chr(60),Chr(39),"A LL")#>
    <cfset Form.Question5 =
    #ReReplaceNoCase(Form.Question5,Chr(62),Chr(39),"A LL")#>
    <cfset Form.Question6 = #Form.Question6#>
    </cfoutput>

    <cfinsert datasource="*" tablename="*"
    formfields="Date,
    Question1,
    Question2,
    Question3,
    Question4,
    Question5,
    Question6">

    That's it... everything is working except the formfields are dissapeared




    alpenman Guest

  6. #6

    Default Re: Processing e-mail data from html-form

    Looks like my guess was wrong.
    This:
    In the first file there is a cfform included in the cfmail tag (I have
    stripped the code):

    won't work

    Instead, put the form and not much else on the first page. On the 2nd page,
    do what you have to do with the form fields, including sending mail to someone.


    Dan Guest

Similar Threads

  1. Form Data processing
    By Mack879w in forum Dreamweaver AppDev
    Replies: 5
    Last Post: August 19th, 04:37 AM
  2. mail via html form advice req
    By Nick in forum PHP Development
    Replies: 4
    Last Post: February 20th, 10:53 AM
  3. I Nd HELP PLEASE html form to PHP - data gets lost
    By P.Parker in forum PHP Development
    Replies: 1
    Last Post: April 6th, 08:03 AM
  4. Editing SQl data in a HTML form
    By Owain Jones in forum PHP Development
    Replies: 0
    Last Post: November 22nd, 04:31 PM
  5. Html form processing
    By Scott in forum PHP Development
    Replies: 1
    Last Post: November 11th, 05:34 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not 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