Contact Form - How to add a Contact form to a Web page


  1. Open the Web page, where you want to add the contact form, and open for editing in HTML view.
  2. Copy and paste the code below into the HTML view in the location you want the form to appear. Then edit the form to suit your requirement, more details are given below.

    <!-- Start NUI Galway Web Form -->
    <form action="/cgi-bin/FormMailNuig.pl" method="post" name="EmailForm" id="EmailForm">
    <input type="hidden" value="example*nuigalway.ie" name="recipient"/>
    <input type="hidden" value="Email Subject" name="subject"/>
    <input type="hidden" value="http://www.nuigalway.ie/{YourWebSite}/thanks.html" name="redirect"/>
    <input name="required" type="hidden" id="required" value="Name, Phone, email"/>
    <table cellpadding="5" cellspacing="0" border="0" width="100%">
    <tr>
    <td class="body">&nbsp;</td>
    <td> <font color="#CC0000">* </font> - <font color="#CC0000">Required Fields</font></td>
    </tr>
    <tr>
    <td><strong> Name:</strong></td>
    <td>
    <input name="Name" type="text" id="Name" size="40"/>
    </td>
    </tr>
    <tr>
    <td><strong>Address:</strong></td>
    <td><text_area name="Address" cols="40" id="Address"></text_area>
    </td>
    </tr>
    <tr>
    <td><strong>Phone:</strong></td>
    <td><input name="Phone" type="text" id="Phone" size="40"/>
    </td>
    </tr>
    <tr>
    <td><strong>Fax:</strong></td>
    <td><input name="Fax" type="text" id="Fax" size="40"/>
    </td>
    </tr>
    <tr>
    <td><strong>Email:</strong></td>
    <td><input name="email" type="text" id="email" size="40"/>
    </td>
    </tr>
    <tr>
    <td>&nbsp;</td>
    <td><br>
    <input type="Submit" Value="Submit"/>
    &nbsp;
    <input type="Reset" Value="Reset"/>
    </td>
    </tr>
    </table>
    </form>
    <!-- End NUI Galway Web Form -->

     

  3. Edit the contact form elements to suit your requirements, the example above asks the user for:
    Name:
    Address:
    Phone:
    Fax:
    Email:
  4. Edit the hidden field values (a,b,c,d) of the contact form to suit your requirements.

    a)<input type="hidden" value="example*nuigalway.ie" name="recipient"/>

    Enter the email address that you wish to receive an email with the contact form’s data. Email addresses used must replace the with a *.

    b)<input type="hidden" value="Email Subject" name ="subject"/>

    Enter the email subject.

    c)<input type="hidden" value="http://www.nuigalway.ie/{YourWebSite}/thanks.html" name="redirect"/>

    Enter the URL of the page you wish to redirect the user to after the contact form is submitted.

    d)<input name="required" type="hidden" id="required" value="Name, Phone, email"/>

    Enter the contact form fields that you wish to be required.



  5. Save the Web page.

  6. Create the redirect Web page, and add your success message.

  7. Test by filling out the form, an email should be send to the specified email address and you should be redirected to your success page.