10 Minutes Web » Knowledge Base
Document information
| Document ID: | 574 |
|---|---|
| Subject: | Adding a custom form |
| Creation date: | 6/9/09 4:18 PM |
| Last modified on: | 9/4/09 10:07 AM |
Adding a custom form(Advanced Topic)
You must be familiar with HTML scripting in order to add a custom form. Follow the steps below to add a form to an existing page.- Log in to your website as an administrator
- Navigate to the page where you want to add a form
- Click the Modify page
button to invoke the editor - Click on the Html Code tab to view the raw HTML script
- Create a script for your form like any other web page with the following exception
- Type "app" for the value of your action attribute
- Create a new hidden parameter with the following values
<input name="operation" value="formsaver" type="hidden">
- When the user submits this form, every parameter that appears in your form is saved to a file and can optionally be sent to you via email.
Example form
<form method="POST">
<table>
<tr>
<td width="25%"><strong>First Name:</strong> </td>
<td width="75%"><input type="text" name="001First_Name" value="" size="20"></td>
</tr>
<tr>
<td><strong>Last Name:</strong> </td>
<td><input type="text" name="002Last_Name" value="" size="20"></td>
</tr>
<tr>
<td><strong>Company:</strong> </td>
<td><input type="text" name="003Company" value="" size="25"></td>
</tr>
<tr>
<td><strong>Phone Number:</strong> </td>
<td><input type="text" name="004Phone_Number" value="" size="15"></td>
</tr>
<tr>
<td><strong>Email:</strong> </td>
<td><input type="text" name="005Email" value="" size="40"></td>
</tr>
<tr>
<td valign="top"><strong>Comments:</strong> </td>
<td><textarea name="006Comments" cols='40' rows='5'></textarea></td>
</tr>
<tr>
<td><strong></strong></td>
<td><input type="submit" value="Save"></td>
</tr>
</table>
<input type="hidden" name="operation" value="formsaver">
</form>
There are two important information to keep in mind:
- Every field starts with 00x. This numbering scheme is used to sort the fields in the email message that is sent to you after someone submits a form.
- An underscore in a field name is replaced by a space character in the generated email.
Optional hidden fields
Optionally, you can use the following hidden fields in your form. These fields have a special purpose and the following table define them.| Field name | Description | Example |
|---|---|---|
| emailSubject | Subject of the email that is sent | <input type="hidden" name="emailSubject" value="New customer lead" /> |
| emailRecipients | Email recipients. If missing recipient list will be read from values you define as admin | <input type="hidden" name="emailRecipients" value="john@abc.com, mary@xyz.com" /> |
| responseTitle | Title of the page that follows form submission | <input type="hidden" name="responseTitle" value="Thank You!" /> |
| responseText | Text of the page that follows form submission | <input type="hidden" name="responseText" value="Thank you for contacting us. Someone will be in touch with you within 24 hours." /> |
User comments
Posted by xALRrjJAJpFrK on 2/13/12 10:51 AM
YwISHk , [url=http://hvqgxhmlldpy.com/]hvqgxhmlldpy[/url], [link=http://yzuczwkgpuku.com/]yzuczwkgpuku[/link], http://mahcekvqtolt.com/
Posted by kulMKZVpvnsCb on 2/9/12 11:07 PM
Enjoyed the php post. Not many blogs worth bkoomarking but this is going on Delicious now!
