Results 1 to 3 of 3

Thread: Feedback Form & Templates

  1. #1
    Join Date
    Jun 2006
    Posts
    214

    Default Feedback Form & Templates

    Nothing fancy here but they work well together and might be helpfull. I will just post the main parts of the forms and templates.

    I use the same formmail.php and fmbadhandler.php for all my forms. Each form has three templates. Good, bad, and mail templates. I use the formamil.ini file for the recipient.

    The form feedback.htm
    HTML Code:
    <h4>Web site Feedback Form</h4>
                <form action="formmail.php" method="post" id="FeedbackForm">       
            <p>  <input name="env_report" value="REMOTE_HOST,REMOTE_ADDR,HTTP_USER_AGENT,AUTH_TYPE,REMOTE_USER" type="hidden" />
              <input name="recipients" value="me" type="hidden" />
              <input name="required" value="email:Your email address,realname:Your name" type="hidden" />          <input type="hidden" name="mail_options" value="KeepLines" />
              
              <input type="hidden" name="subject" value="Website Feedback" />
              <input type="hidden" name="conditions" value=":#
     #TEST#email ~ /^[a-z0-9_.]+@[a-z0-9_]+\.([a-z0-9_.]+)*[a-z0-9_.]$/i #
     Please enter a valid email address.#" />
              <input type="hidden" name="bad_url" value="fmbadhandler.php" />
              <input type="hidden" name="this_form" value="feedback.htm" />
              <input type="hidden" name="good_template" value="feedback.tpl" />
              <input type="hidden" name="bad_template" value="feedback_err.tpl" />
              <input type="hidden" name="mail_options" value="HTMLTemplate=feedback_mail.tpl,TemplateMissing=N/A" />
               <input type="hidden" name="derive_fields" value=" date=%date%,time=%hour12%.%':'%.%min% + %AMPM%,day=%dayname%,timezone=%tzname%" />
              
            </p>
            <table border="1" cellspacing="5%" id="table1">
              <tr>
                <td><p>Please enter your name:</p></td>
                <td>*
                  <input type="text" name="realname" maxlength="30" />
                </td>
              </tr>
              <tr>
                <td><p>Please enter your email address:</p></td>
                <td>*
                  <input type="text" name="email" maxlength="60" />
                </td>
              </tr>
              <tr>
                <td>Phone number:</td>
                <td><input maxlength="3" size="3" name="areacodeHXYSIP" id="areacodeHXYSIP" onblur="if(!validNumber(this.value)){if(isMSIE4Min()){this.focus();this.select();}alert('Must be numeric');}" onchange="t_HXYSIP.value=areacodeHXYSIP.value+prefixHXYSIP.value+sufixHXYSIP.value;DoRule_t_HXYSIP();" type="text" />
                  <strong>-</strong>
                  <input maxlength="3" size="3" name="prefixHXYSIP" id="prefixHXYSIP" onblur="if(!validNumber(this.value)){if(isMSIE4Min()){this.focus();this.select();}alert('Must be numeric');}" onchange="t_HXYSIP.value=areacodeHXYSIP.value+prefixHXYSIP.value+sufixHXYSIP.value;DoRule_t_HXYSIP();" type="text" />
                  <strong>-</strong>
                  <input maxlength="4" size="4" name="sufixHXYSIP" id="sufixHXYSIP" onblur="if(!validNumber(this.value)){if(isMSIE4Min()){this.focus();this.select();}alert('Must be numeric');}" onchange="t_HXYSIP.value=areacodeHXYSIP.value+prefixHXYSIP.value+sufixHXYSIP.value;DoRule_t_HXYSIP();" type="text" />
                  <input value="" id="t_HXYSIP" name="t_HXYSIP" onkeypress="      return noenter(this,event)     " onkeydown="      return noenter(this,event)     " onchange="" type="hidden" /></td>
              </tr>
              <tr>
                <td>May we contact you?</td>
                <td>Yes
                    <input name="contact" value="Yes Contact Me" type="radio" />
                    No
                    <input name="contact" value="No Do Not Contact Me" type="radio" />
                 </td>
              </tr>
              <tr>
                <td>Subject of feedback?</td>
                <td>Comment
                    <input name="reason" value="Comment" type="checkbox" />
                    Suggestion
                    <input name="reason" value="Suggestion" type="checkbox" />
                    Other
                    <input name="reason" value="Other" type="checkbox" />
                 </td>
              </tr>
              <tr>
                <td valign="top">Please enter your message:</td>
                <td><p style="text-align: center">
                    <textarea name="mesg" rows="5" cols="40"></textarea>
                  </p></td>
              </tr>
              <tr>
                <td><input type="submit" value="Submit" /></td>
              </tr>
            </table>
          </form>
    The Bad Template feedback_err.tpl
    HTML Code:
    <h2>Form Error</h2>
          <p><i>Please correct the errors to submit.</i> You can use your back arrow to return to the form. The previous information submited should be there. Just fill in the missing items and submit again. </p>
          <p><b>Here is the full error message:</b><fmfullerror /></p>
    The Good Template feedback.tpl
    HTML Code:
     <h2>Success!
          </h2>
          <p>Thanks for submitting your information to us.</p>
          <p>Here is the information you submitted:</p>
          <table border="1">
            <tr>
              <td class="labelcell"><p style="text-align: left">Your name:</p></td>
              <td class="fieldcell"><p style="text-align: left">$realname</p></td>
            </tr>
            <tr>
              <td class="labelcell"><p style="text-align: left">Your email address:</p></td>
              <td class="fieldcell"><p style="text-align: left">$email</p></td>
            </tr>
            <tr>
              <td class="labelcell"><p style="text-align: left">Your phone number:</p></td>
              <td class="fieldcell"><p style="text-align: left">$areacodeHXYSIP-$prefixHXYSIP-$sufixHXYSIP<br />
                <br />
              </p></td>
            </tr>
            <tr>
              <td class="labelcell"><p style="text-align: left">May we contact you?</p></td>
              <td class="fieldcell"><p style="text-align: left">$contact</p></td>
            </tr>
            <tr>
              <td class="labelcell"><p style="text-align: left">Type of feedback:</p></td>
              <td class="fieldcell"><p style="text-align: left">$reason</p></td>
            </tr>
            <tr>
              <td class="labelcell"><p style="text-align: left">Submitted on</p></td>
              <td class="fieldcell"><p style="text-align: left">$day, $date, $time, $timezone</p></td>
            </tr>
            <tr>
              <td valign="top" class="labelcell"><p style="text-align: left">Your message to us was:</p></td>
              <td class="fieldcell"><p style="text-align: left">$mesg</p></td>
            </tr>
            <tr><td>For your receipt<td><A HREF="javascript:window.print()">Click to Print This Page</A></td></tr>
          </table>
    The Email Template feedback_mail.tpl
    HTML Code:
    <h2>Feedback
          </h2>
          
          <p>Here is the information submitted:</p>
          <table border="1">
            <tr>
              <td class="labelcell"><p style="text-align: left">Submitted:</p></td>
              <td class="fieldcell"><p style="text-align: left">$day, $date, $time, $timezone</p></td>
            </tr>
            <tr>
              <td class="labelcell"><p style="text-align: left">Name:</p></td>
              <td class="fieldcell"><p style="text-align: left">$realname</p></td>
            </tr>
            <tr>
              <td class="labelcell"><p style="text-align: left">Email:</p></td>
              <td class="fieldcell"><p style="text-align: left">$email</p></td>
            </tr>
            <tr>
              <td class="labelcell"><p style="text-align: left">Phone:</p></td>
              <td class="fieldcell"><p style="text-align: left">$areacodeHXYSIP-$prefixHXYSIP-$sufixHXYSIP<br />
                <br />
              </p></td>
            </tr>
            <tr>
              <td class="labelcell"><p style="text-align: left">Contact:</p></td>
              <td class="fieldcell"><p style="text-align: left">$contact</p></td>
            </tr>
            <tr>
              <td class="labelcell"><p style="text-align: left">Feedback:</p></td>
              <td class="fieldcell"><p style="text-align: left">$reason</p></td>
            </tr>
            <tr>
              <td valign="top" class="labelcell"><p style="text-align: left">Message:</p></td>
              <td class="fieldcell"><p style="text-align: left">$mesg</p></td>
            </tr>
            </table>
    Formmail INI formmail.ini
    HTML Code:
    [email_addresses]
    me = "mailsendsto@here.com"

  2. #2
    Join Date
    Feb 2007
    Posts
    82

    Default Re: Feedback Form & Templates

    When I try this, I can get the good template to work, but no results in email, so then if I take off the good template, I get email results.
    not sure what I am doing wrong, but I know I don't have the formhandler.php, so I am going to check on that now
    great help btw

  3. #3
    Join Date
    May 2007
    Posts
    11

    Default Re: Feedback Form & Templates

    Thanks for the code for verifying email addresses. I happen to have an hyphen in my email address, so I quickly became aware that the hyphen is missing from the validation. So if someone wants to 'borrow' the validation code, it might be a good idea to add the hyphen to the validation

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Formail, Turbomailer & mass mailing
    By EPierre in forum FormMail Subscription Support
    Replies: 2
    Last Post: 10-Feb-2005, 09:28 PM
  2. New Server - Templates sent as plain text
    By Anubis in forum FormMail Subscription Support
    Replies: 10
    Last Post: 19-Jan-2005, 10:30 AM
  3. Avoid feedback messages
    By NOgbourne in forum FormMail Subscription Support
    Replies: 3
    Last Post: 17-Nov-2004, 10:57 AM
  4. Having trouble with the CC & BCC
    By madref in forum FormMail Subscription Support
    Replies: 5
    Last Post: 01-Oct-2004, 04:31 AM
  5. Sample Auto Responder Form & Template
    By russellr in forum FormMail
    Replies: 0
    Last Post: 04-Sep-2004, 10:15 PM

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
  •