Adding a custom form to a site

From WikiName
Jump to: navigation, search

To create a new custom form you need to do the following:


Working on Layout 40+ sites; should work on older sites, but not tested Create a form in a web page as usual. Set the form's ACTION to "send_email.htm"


STEP 1 Go into any free consultation form and copy the actual form code into a new web page. Name web page whatever you like.

STEP 2 in top section of the form make sure to add the following hidden fields: email_to, and email_subject. Set the value attribute for each field to appropriate values (e.g.: <input type="hidden" name="email_to" value="" />). These will control what the email subject is, and who receives the email.

Example: <form id="consult" action="send_email.htm" method="post"><input type="hidden" name="email_to" value="" /><input type="hidden" name="email_subject" value="Dental Practice Survey" />

To test form before making it live please try setting the "email_to" field to your own email address for an initial test, just to ensure that it comes out the way you want it.

STEP 3 Down in form where Email Address is placed, create a field named email_from and prompt users filling out the form to enter their email address (e.g.: Your Email Address<*br /><*input type="text" name="email_from" value="" />). This will control what email address the email is sent from.

Example: <tr> <td class="label">Email Address*</td> <td class="input req"><input type="text" name="email_from" value="" /></td> </tr>

Optionally, you can add fields (hidden or text) for email_cc and email_bcc as well.

OPTIONAL STEPS Create other fields as you see fit. In the email, the fields will appear in the order that you enter them, and will be labeled by replacing any underscores with spaces, and capitalizing the first letter on each word. For example, <*input type="text" name="how_you_found_us" value="" /> will be sent to the email recipient as "How You Found Us: whatever the visitor wrote"

STEP 4 Thank You Page - Specifies a custom TY page that the user will be taken to after successfully filling out the form. If one isn't specified, they will be taken to a generic page. You must create a page by the same name in the account's Web Pages database. Example:

<*input type="hidden" name="ty_page" value="ty_practice_survey.htm" />

STEP 5 Required Fields - Specifies the fields on the form that MUST be filled out before proceeding. The fields listed should match the "name" attribute of inputs you've included on the form, comma separated, no spaces.


<*input type="hidden" name="required_fields" value="first_name,last_name,company,how_you_found_us" />

So, if the user doesn't fill out their first name, last name, company, or "How You Found Us," they will receive an error prompting them to fill out those fields before they can proceed.

STEP 6 Post a discussion note asking Quasars to "activate the form" by creating a new script to handle the form. Ray said, "we may have a better way, but this was the easiest to get this to work."

STEP 7 Test form using your email address as the send to email address in HTML. Make sure to change the send to email address back to client before making it live.


1) Can I use the same form id called "consult" for all 3 forms?
    Yes, all of the form ID's can be the same. The only time they should be different is when several forms appear on the same page.

2) Will these new forms work and send an email to the client without any further action on your part or mine? If not, what do I need to do to make these forms work?
    You will need to follow some basic steps (listed below), but overall there's nothing special the needs to be done.

3) I removed a field/entire table row on each of the two new forms. Does that have a negative impact that I need to be aware of?
    The only required fields will be "email from," "email to," and "subject." Everything else is completely up to you.

4) I changed some text in the instructions and above the last comment box. Does that have a negative impact I should be aware of?
5) I changed the subject value for both forms. Will the new subject get passed properly in the email that gets sent?
    Yes, but make sure the field name for the subject matches the instructions below.

6) For future forms, what would we need to do if we added a field (new field) to the form to make it work and have that new field info pass in the email? Can we make those changes or does that involve you?     
    The form will pick up all additional fields automatically. Nothing else needs to be done on your part, as long as you follow the instructions below.