PHP form not picking up a field

I would appreciate some assistance. I am very green when it comes to programming so please excuse my lack of understanding / number of questions :slight_smile:

I have two sites for a client, both of which use a similar form structure, both of which are built in PHP. The form is a quotation request form with 3 pages on it, the last of which has an area for the customer to enter their contact details and also has a ‘comments’ section for them to submit specific comments regarding their enquiry. I have attached a screenshot of this page for reference.

When a customer submits the quote, and email is sent to the company and it specifies the contact details, what the enquiry was in relation to, and the location. Here however is the issue. On one of the sites, there is no issue. Comments submitted are transferred in the emai.

The other site however, sends the details to the client capturing everything except whatever is included in the ‘comments’ box on the form.

I compared the code between the two sites for this form, and as I said I am not a programmer, but found the only difference was that on the form that was working (on the attached coding titled ‘OFFSHORE’) there is the code: id=“comment” inserted within the relevant section of code, however this is missing off the coding for the site that has the issue (called ‘MAIN’ on the attached).

I thought perhaps this was the issue so added this id=“comment” into the code on the php template in WordPress and it has made no difference.

My questions:

  1. How do I fix this so that the comments are sent in the email to the client for the site having issues?

  2. For my own learning, what does id=“comment” mean? I assumed this picked up text in the comments section and transferred with the email, however I may be completely off track.

I have attached the relevant code pieces I refer to, along with the full code for the page on which we are having issues where this id=“comments” is missing on line 223.




If you can, and if your clients allow you, please display the code that you are referencing. This allows us to understand your situation better and allows us to show you what you are doing wrong or what you can do to better your code. When showing us your code please use the php button so it can display properly and if the code includes protected information, replace it with *******.



Thanks, I thought was already attached as a txt file? I am not 100% sure if that is what you mean, however have attached again. I am not sure what you mean by using the PHP button - please let me know if this is not sufficient


Issues with Comments on form for sites.txt (11.5 KB)


I have taken the code from the included txt file and displayed it for all to see so people don’t have to download it:


<div class="comments"> <h5>Comments</h5> <textarea class="text" name="comment" id="comment"><?php echo $form->value('comment'); ?></textarea> </div> <div class="recaptcha">

Main Site

<div class="comments"> <h5>Comments</h5> <textarea class="text" name="comment"><?php echo $form->value('comment'); ?></textarea> </div>

Missing in Main site: id=“comment” after name=“comment”


include “form_system.php”;
$form = new formSession($_REQUEST);

$activeOptions = $form->getProductFeatureMatrix();
$productId = intval(str_replace(‘product’, ‘’, $form->value(‘product_selection’)));

if (is_array($activeOptions[$productId])){
$activeOptions = $activeOptions[$productId];
else {
$activeOptions = $form->productFeatureArray(true,true,true,true,true,true,true,true,true,true,true,true,true,true,true);


Required Options Add Your Options Can't find your accessory?
  • No Options

    I don't require any options.
  • Lock Box

    Steel plate box which is welded onto the doors helps protect your padlocks from bolt cutters and grinders. <?php echo ($activeOptions['lockbox'] ? '' : '
    '); ?>
  • Painting

    Preparation and painting of the interior and exterior of the container. <?php echo ($activeOptions['painting'] ? '' : '
    '); ?>
  • Electrical Fit Out

    Lighting, Power Points, Air Conditioning. <?php echo ($activeOptions['electric'] ? '' : '
    '); ?>
  • Floor Vents

    Air vents installed to allow Air Flow. <?php echo ($activeOptions['floorvent'] ? '' : '
    '); ?>
  • Window

    Aluminium sliding windows. <?php echo ($activeOptions['window'] ? '' : '
    '); ?>
  • Side Access Door

    Personal access or forklift doors. <?php echo ($activeOptions['sidedoor'] ? '' : '
    '); ?>
  • Whirly Bird

    Installed on the roof to help with heat build up. <?php echo ($activeOptions['whirlyb'] ? '' : '
    '); ?>
  • Insulation

    Installation of 50mm refrigeration panels on the roof and walls. <?php echo ($activeOptions['insulation'] ? '' : '
    '); ?>
  • Shelving

    Custom built or pre-fabricated shelving to your specifications. <?php echo ($activeOptions['shelving'] ? '' : '
    '); ?>
  • Roller Doors

    Installation of a garage style roller door into the doors or wall of your container. <?php echo ($activeOptions['rollerd'] ? '' : '
    '); ?>
  • Can't find your accessory or modification?

    Describe your requirement below:
    ><?php echo $form->value('accessory_requirement', ''); ?>
Full Name
Email Address
<?php echo $form->value('comment'); ?>
Verification (case insensitive)
CAPTCHA Image <?php if (isset($_SESSION['reCaptchaError'])) { echo '' . $_SESSION['reCaptchaError'] . ''; unset($_SESSION['reCaptchaError']); } ?>
Refresh image
valueIs('special_offers', 'on') ? ' checked="checked"' : ''); ?> /> Check this box if you would like to be advisted of special offers from time to time Change Settings

I’ll take a look at it and see if I can find your problem when I get a chance; however, if someone else beats me to it that’s fine. While including your code in an attachment is fine, most people prefer it if you inject your code into your post.


Great, thanks for the tip, much appreciated :slight_smile:

Sponsor our Newsletter | Privacy Policy | Terms of Service