Page 1 of 3 123 LastLast
Results 1 to 10 of 27

Thread: Sending form results in an HTML email

  1. #1
    Join Date
    Dec 2003
    Posts
    3,980

    Default Sending form results in an HTML email

    This HOW TO guide is now on our main website.
    Last edited by russellr; 25-Aug-2010 at 06:35 AM. Reason: Moved to main website.
    Russell Robinson - Author of Tectite FormMail and FormMailDecoder
    http://www.tectite.com/

  2. #2
    Join Date
    Sep 2004
    Posts
    3

    Cool Re: Sending form results in an HTML email

    can we get radio buttons information through an html form template... your informations dont cover this issue?

    May be a silly one and would be cool if we can.

    Mike

  3. #3
    Join Date
    Dec 2003
    Posts
    3,980

    Default Re: Sending form results in an HTML email

    Hi,

    You can display the selected value of a set of radio buttons, but you can't show radio buttons in the template.

    For example, with this form:
    Code:
    What do you like?
    Noise: <input type="radio" name="likes" value="noise" />
    Silence: <input type="radio" name="likes" value="silence" />
    You can do this in your template:
    Code:
    Person likes: $likes
    which will show as:

    Code:
    Person likes: noise
    or
    Code:
    Person likes: silence
    To show as radio buttons instead is quite tricky. However, we do have the technology to achieve this, so we've put the idea on our TO-DO list for FormMail.
    Russell Robinson - Author of Tectite FormMail and FormMailDecoder
    http://www.tectite.com/

  4. #4
    Join Date
    Sep 2004
    Posts
    3

    Question Re: Sending form results in an HTML email

    Hi Russel

    Thanks for the response
    I have set the template up but when I submit I get the following error report

    An error occurred while processing the form.

    Please contact us directly since this form is not working.
    We apologize for any inconvenience this error may have caused.

    I have an attach feature set up on my form is this affecting the submission of my form results by html template?

    Mike

  5. #5
    Join Date
    Dec 2003
    Posts
    3,980

    Default Re: Sending form results in an HTML email

    Hi,

    You'll need to set DEF_ALERT in FormMail so that you get an alert message sent to you.

    The alert message will tell us what the problem is.
    Russell Robinson - Author of Tectite FormMail and FormMailDecoder
    http://www.tectite.com/

  6. #6
    Join Date
    Sep 2004
    Posts
    3

    Talking Re: Sending form results in an HTML email

    Russell

    You are the man! This script is awesome and the form works like a treat!!

    Now to have some fun!

    Mike

  7. #7
    Join Date
    Oct 2004
    Posts
    6

    Default Re: Sending form results in an HTML email

    Hey Russell,

    Is there any way to get "zero" values passed through the script? What I mean is I can use "TemplateMissing=N/A" to get "N/A" printed in an HTML email for fields that did not have any data input but when they put a "0" (zero) in the field, the script returns "N/A" in the email.

    Thanks,

    sebestyen

  8. #8
    Join Date
    Dec 2003
    Posts
    3,980

    Default Re: Sending form results in an HTML email

    Hi,

    Well, you could make "TemplateMissing=0" (zero), but that's going to look funny on text fields.

    Another way would be to provide an initial value of "0" on your numeric fields.

    Make the non-required numeric fields initially zero, and leave the required numeric fields blank (and put them in the "required" specification).
    Russell Robinson - Author of Tectite FormMail and FormMailDecoder
    http://www.tectite.com/

  9. #9
    Join Date
    Feb 2005
    Posts
    12

    Default Re: Sending form results in an HTML email

    Russell, your FormMail is great! But I have one question:

    I've got 14 select boxes in my form, the visitor can select the documentation he wan't to obtain.

    In my form it's like this: <input type="check-box" name="document1" value="Documentation_Name">

    I've got something like this in my HTML template:

    <table>
    <tr>
    <tdDocumentation:</td>
    </tr>
    <tr>
    <td>
    $document1<br>
    $document2<br>
    $document3<br>
    $document4<br>
    </td>
    </tr>
    </table>

    But when they only want to obtain document4, I have 3 empty lines in my mail.. When I remove the <br> tags, all the documents are put together as one line. When I put them in seperate <td>'s I get a load of empty TD's and the result is the same.

    Is there a way to only show the lines that are filled? (skip some code or something). I can't use PHP in the template can I?

  10. #10
    Join Date
    Dec 2003
    Posts
    3,980

    Default Re: Sending form results in an HTML email

    Hi,

    That's a limitation of HTML.

    FormMail can help you out though.

    BTW, if you have this:

    Code:
    <input type="check-box" name="document1" value="Documentation_Name">
    it should be this:

    Code:
    <input type="checkbox" name="document1" value="Documentation_Name">
    (no hyphen)

    Step 1

    Instead of 4 different checkbox fields, make it one checkbox field, like this:

    Code:
    Document 1: <input type="checkbox" name="documents[]" /> <br />
    Document 2: <input type="checkbox" name="documents[]" /> <br />
    Document 3: <input type="checkbox" name="documents[]" /> <br />
    Document 4: <input type="checkbox" name="documents[]" /> <br />
    Now, in your template, you can just refer to $documents:

    Code:
    <table>
    <tr>
    <tdDocumentation:</td>
    </tr>
    <tr>
    <td>
    $documents
    </td>
    </tr>
    </table>
    That get's the data in with comma separators.

    Step 2

    If you want them on separate lines, add the following to your form:

    Code:
    <input type="hidden" name="template_list_sep" value="<br />" />
    FormMail will now put "<br />" between each item in the list and you'll get exactly the right number of lines.

    Enjoy!

    BTW, yes, your templates can be PHP. You just need to tell FormMail to open then as URLs instead of files (set $TEMPLATEURL instead of $TEMPLATEDIR).
    Russell Robinson - Author of Tectite FormMail and FormMailDecoder
    http://www.tectite.com/

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Sample HTML Form Using FormMail
    By russellr in forum FormMail
    Replies: 1
    Last Post: 21-Mar-2007, 06:49 AM
  2. send an email in HTML
    By michecosta in forum FormMail Subscription Support
    Replies: 3
    Last Post: 25-May-2004, 08:18 PM
  3. POST form data as well as email
    By zippy in forum FormMail Subscription Support
    Replies: 20
    Last Post: 24-Jan-2004, 04:29 PM
  4. autoresponder to email from form
    By rebirth in forum FormMail Subscription Support
    Replies: 2
    Last Post: 21-Jan-2004, 04:43 AM
  5. Help trying to set up a form to email and send info to file
    By rridsdale in forum FormMail Subscription Support
    Replies: 1
    Last Post: 14-Jan-2004, 02:38 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
  •