Form Fields (required)

Required Form Fields

When creating an enquiry / feedback web page at least one field is required in order for the form to be submitted to a recipient.

The Recipient field specifies to whom the form results are to be emailed. This field will likely be configured as a hidden form field with a value equal to a valid e-mail address. Optional fields may be added as required.

Syntax:

The following code must be entered anywhere inside your Form tags:

<input type=hidden name="recipient" value="recipient@mydomainname.tld">

Where: recipient@mydomainname.tld is the receiving email address.

Example:

This example displays the required form fields along with several optional fields.

Code Result
<html>
<body>
<FORM METHOD=POST ACTION=”/cgi-bin/formmail/FormMail.pl”>
<INPUT TYPE=HIDDEN NAME=”recipient” VALUE=”sales@mydomain.com.au”>
<INPUT TYPE=HIDDEN NAME=”subject” VALUE=”Form Submitted Email”>
<P>Please enter your Name:</P><INPUT NAME=”Realname”>
<P>Enter your comments:</P>
<TEXTAREA COLS=19 ROWS=5 NAME=”user_comment”></TEXTAREA>
<INPUT TYPE=SUBMIT VALUE=”Send Comments”>
</FORM>
</body>
</html>
Please enter your Name: 

Enter your comments: 

The following information is then sent to the recipient email address specified:

Return-Path: <return@userdomainname.tld>
Date: Fri, 3 Jul  2010 13:33:30 +1000
To: sales@mydomain.com.au
Subject: Form Submitted Email
Email: Below is the result of your feedback form.
It was  submitted by realname() on
Friday, July 3, 2010 at 13:33:30
---------------------------------------------
user_comment: These are the comments typed into the comment field.
---------------------------------------------

Note: The code in this article is for information only. Netregistry cannot provide support for website coding related issues.  Please contact a website developer for issues related to programming with HTML.

Anti-spam measure

The recipient email address specified in the HTML code should be an email address related to your domain name.

If another domain name is required:

  1. Open a new *.txt file (using Notepad)
  2. Type each recipient on a new line. e.g:myalternateaddress@hotmail.com
    myalternateaddress@yahoo.com
  3. Name or save the *.txt file allowed_recipients.txt.
  4. Upload this file to the /CGI-BIN directory.