Announcement

Collapse
No announcement yet.

Contact us form - editable?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Contact us form - editable?

    Hello, it would be useful to alter the default "Contact Us" form, so ive added some extra slots....but although the form "works" - only 3 bits of info go through to the emailer. That would be the

    "Name:"
    "Email Address:"
    "Message:"

    Is there some way to do this? So the info actually works? This is what ive done anyway -

    Code:
    <form method="post" action="<Actinic:Variable Name="SendMailPageURL"/>">
    <input type="hidden" name="RANDOM" value="<actinic:variable name='Random'/>" />
      
    <actinic:block if="%3cactinic%3avariable%20name%3d%22IsHostMode%22%20%2f%3e">
       <!-- Hidden field when in trial mode -->
       <input type="hidden" name="SHOP" value="<Actinic:Variable Name="HiddenFields"/>" />
    </actinic:block>        
    
    <actinic:variable Name="ValidationError"/>
    <input type="hidden" name="Subject" value="Newsletter" /> 
    <table cellpadding="3" cellspacing="0">
       <tr> 
          <td width="15">&nbsp;</td>
          <td colspan="2">
             <strong><Actinic:Variable Name="MailFormHeader"/></strong><br /> 
             <br>
             <strong>Business Details</strong><br />      </td>
       </tr>
       <tr> 
          <td>&nbsp;</td>
          <td>
             Trading Name</td>
          <td>
             <input name="Name" type="text" id="Name" value="" size="50" />      </td>
       </tr>
         <tr> 
          <td>&nbsp;</td>
          <td>
             Trading Address</td>
          <td>
             <textarea name="Message" cols="50" rows="5" id="Message"></textarea>      </td>
       </tr>
       <tr> 
          <td>&nbsp;</td>
          <td>Tel No.      </td>
          <td><input name="Tel_No" type="text" id="Tel_No" value="" size="50" /></td>
       </tr>
       <tr>
         <td>&nbsp;</td>
         <td>Fax No. </td>
         <td><input name="Fax_No" type="text" id="Fax_No" value="" size="50" /></td>
       </tr>
       
       <tr>
         <td>&nbsp;</td>
         <td>Website Address</td>
         <td><input name="Website_address" type="text" id="Website_address" value="" size="50" /></td>
       </tr>
       <tr>
         <td>&nbsp;</td>
         <td><span class="actrequired">
            <Actinic:Variable Name="MailFormEmail"/> 
          *</span> </td>
         <td><input type="text" name="EmailAddress" size="50" value="" />     </td>
       </tr>
       
       <tr>
         <td>&nbsp;</td>
         <td>Nature of Business</td>
         <td><input name="Nature_Of_Business" type="text" id="Nature_Of_Business" value="" size="50" /></td>
       </tr>
       <tr>
         <td>&nbsp;</td>
         <td>Status</td>
         <td> LTD Company:
           <input type="radio" checked="checked" name="Limited_Company" value="yes" />
           <br>
           Sole Trader:
           <input type="radio" name="Sole_Trader" value="no" />
           <br>
           Partnership:
           <input type="radio" name="Partnership" value="no" /></td>
       </tr>
       <tr>
         <td>&nbsp;</td>
         <td>Ltd Co. Reg. No.</td>
         <td><input name="Reg_no" type="text" id="Reg_no" value="" size="50" /></td>
       </tr>
       <tr>
         <td>&nbsp;</td>
         <td>Address of Ltd Co. <br>
          Registered Office</td>
         <td><input name="Reg_Office" type="text" id="Reg_Office" value="" size="50" /></td>
       </tr>
       <tr>
         <td>&nbsp;</td>
         <td>VAT No.</td>
         <td><input name="VAT_No" type="text" id="VAT_No" value="" size="50" /></td>
       </tr>
       <tr>
         <td>&nbsp;</td>
         <td>Annual Turnover</td>
         <td><input name="Annual_Turnover" type="text" id="Annual_Turnover" value="" size="50" /></td>
       </tr>
       <tr>
         <td>&nbsp;</td>
         <td>No. of Years Trading</td>
         <td><input name="Years_Trading" type="text" id="Years_Trading" value="" size="50" /></td>
       </tr>
       <tr>
         <td valign="top">&nbsp;</td>
         <td colspan="2" valign="top">&nbsp;</td>
       </tr>
       <tr>
         <td valign="top">&nbsp;</td>
         <td colspan="2" valign="top"><strong>Directors/Proprietors/Partners Details</strong></td>
       </tr>
       <tr>
         <td>&nbsp;</td>
         <td>Full Name</td>
         <td><input name="Full_Name" type="text" id="Full_Name" value="" size="50" /></td>
       </tr>
       
       <tr>
         <td>&nbsp;</td>
         <td> Home Address</td>
         <td><textarea name="Home_Address" cols="50" rows="5" id="Home_Address"></textarea>     </td>
       </tr>
       <tr>
         <td>&nbsp;</td>
         <td>Home Phone No.</td>
         <td><input name="Home_Phone_No" type="text" id="Home_Phone_No" value="" size="50" /></td>
       </tr>
       <tr>
         <td valign="top">&nbsp;</td>
         <td colspan="2" valign="top">&nbsp;</td>
       </tr>
       <tr>
         <td valign="top">&nbsp;</td>
         <td colspan="2" valign="top"><strong>Trade Reference No1</strong></td>
       </tr>
       <tr>
         <td>&nbsp;</td>
         <td>Name </td>
         <td><input name="ref1_Name" type="text" id="ref1_Name" value="" size="50" /></td>
       </tr>
       <tr>
         <td>&nbsp;</td>
         <td> Address</td>
         <td><textarea name="ref1_Address" cols="50" rows="5" id="ref1_Address"></textarea>     </td>
       </tr>
       <tr>
         <td>&nbsp;</td>
         <td>Phone</td>
         <td><input name="ref1_Phone" type="text" id="ref1_Phone" value="" size="50" /></td>
       </tr>
       <tr>
         <td valign="top">&nbsp;</td>
         <td colspan="2" valign="top">&nbsp;</td>
       </tr>
       <tr>
         <td valign="top">&nbsp;</td>
         <td colspan="2" valign="top"><strong>Trade Reference No2</strong></td>
       </tr>
       <tr>
         <td>&nbsp;</td>
         <td>Name </td>
         <td><input name="ref2_Name" type="text" id="ref2_Name" value="" size="50" /></td>
       </tr>
       <tr>
         <td>&nbsp;</td>
         <td> Address</td>
         <td><textarea name="ref2_Address" cols="50" rows="5" id="ref2_Address"></textarea>     </td>
       </tr>
       <tr>
         <td>&nbsp;</td>
         <td>Phone</td>
         <td><input name="ref2_Phone" type="text" id="ref2_Phone" value="" size="50" /></td>
       </tr>
       
       
       <tr>
         <td valign="top">&nbsp;</td>
         <td colspan="2" valign="top">&nbsp;</td>
       </tr>
       <tr>
         <td>&nbsp;</td>
         <td>Do you wish to be <br>
          added to our website<br> 
          dealer locator?</td>
         <td> Yes:
           <input type="radio" checked="checked" name="Yes" value="Yes" />
             <br>
           No:
           <input type="radio" name="No" value="No" />
           <br></td>
       </tr>
       <tr>
         <td valign="top">&nbsp;</td>
         <td colspan="2" valign="top">&nbsp;</td>
       </tr>
       <tr>
         <td valign="top">&nbsp;</td>
         <td valign="top">&nbsp;</td>
         <td><input type="submit" name="ACTION" value="<Actinic:Variable Name="MailFormSendButton"/>" />     </td>
       </tr>
       <tr>
         <td valign="top">&nbsp;</td>
         <td colspan="2" valign="top">&nbsp;</td>
       </tr>
    </table>
    
    </form>

    #2
    adding stuff into the form itself is easy but you need to edit the mailform.pl file to get this information OUT of the form and INTO the email

    This is Darren's forté so I'll let him reply with the 'how to'
    Tracey

    Comment


      #3
      Oi it certainly aint my forte, not sure what is yet but.......

      Anyway you need to edit the perl scripts, the ones that process the information from the form

      find the lines in the mailform.pl script and add the extra lines as shown below, notice i have included extra information for address fields, these must correspond with your form fields, the getphrase are actinics own parts, you need to edit the inputhash fields, if you dont need them delete them, if you need extra then copy them.

      Code:
      # Construct the mail text and send it to the merchant
              #
              $sError = ACTINIC::GetPhrase(-1, 2377);
              $sTextMailBody .= ACTINIC::GetPhrase(-1, 2370) . $sName . "\r\n";
              $sTextMailBody .= "Company or House: " . $::g_InputHash{'HOUSE'} . "\r\n";
              $sTextMailBody .= "Street: " . $::g_InputHash{'ADDRESS1'} . "\r\n";
              $sTextMailBody .= "Town: " . $::g_InputHash{'ADDRESS2'} . "\r\n";
              $sTextMailBody .= "City: " . $::g_InputHash{'ADDRESS3'} . "\r\n";
              $sTextMailBody .= "County: " . $::g_InputHash{'ADDRESS4'} . "\r\n";
              $sTextMailBody .= "PostCode: " . $::g_InputHash{'ADDRESS5'} . "\r\n";
              $sTextMailBody .= ACTINIC::GetPhrase(-1, 2371) . $sEmailRecpt . "\r\n";
              $sTextMailBody .= "Phone Number: " . $::g_InputHash{'PHONE'} . "\r\n";
              $sTextMailBody .= ACTINIC::GetPhrase(-1, 2373) . "\r\n" . $sMessage . "\r\n\r\n";
              my @Response = ACTINIC::SendMail($::g_sSmtpServer, $$::g_pSetupBlob{EMAIL}, $sSubject, $sTextMailBody, $sEmailRecpt);
              if ($Response[0] != $::SUCCESS)
                  {
                  ACTINIC::RecordErrors($Response[1], ACTINIC::GetPath());
                  $sError = $Response[1];
                  }
              #
              # Now bounce back to the mail page
      remember if you break it dont blame me, always make a copy in case it go's wrong

      Comment


        #4
        http://community.actinic.com/showthread.php?t=45061
        Last edited by KB2; 23-Mar-2010, 10:29 AM. Reason: Updating kb links
        ********************
        Tracey
        SellerDeck

        Comment


          #5
          Yer that answer to

          Comment


            #6
            thx for the help there. One query tho....i would like to add a radio selection -
            <input type="radio" checked="checked" name="Limited_Company" value="yes" />
            <br>
            Sole Trader:
            <input type="radio" name="Sole_Trader" value="no" />
            <br>
            Partnership:
            <input type="radio" name="Partnership" value="no" />

            would it possible just to add another selection thro MailForm.pl, using another 15 steps or so? Or would the radio button not work when i get my email response?

            Comment


              #7
              Hi Richard,

              You need to give your radio buttons the same name and set the 'value' to the same as the prompt, for example:

              Limited Company:<input type="radio" checked="checked" name="CompanyType" value="Limited Company" />
              <br>
              Sole Trader: <input type="radio" name="CompanyType" value="Sole Trader" />
              <br>
              Partnership: <input type="radio" name="CompanyType" value="Partnership" />

              Then you would only add one variable to the script for '$sCompanyType' as per the knowledebase article. The value of the selected item will be entered into the email.
              ********************
              Tracey
              SellerDeck

              Comment

              Working...
              X