Because probably you are doing it wrong - you can't place this code anywhere.
Original code looks this way:
- Code: Select all
<p class="contact-name"><?php echo $this->form->getLabel('contact_name'); ?> <?php echo $this->form->getInput('contact_name'); ?> </p>
<p class="contact-email"><?php echo $this->form->getLabel('contact_email'); ?> <?php echo $this->form->getInput('contact_email'); ?></p>
<p><?php echo $this->form->getLabel('contact_subject'); ?> <?php echo $this->form->getInput('contact_subject'); ?></p>
<?php //Dynamically load any additional fields from plugins. ?>
<?php foreach ($this->form->getFieldsets() as $fieldset): ?>
<?php if ($fieldset->name != 'contact'):?>
<?php $fields = $this->form->getFieldset($fieldset->name);?>
<?php foreach($fields as $field): ?>
<?php if ($field->hidden): ?>
<?php echo $field->input;?>
<?php else:?>
<p> <?php echo $field->label; ?>
<?php if (!$field->required && $field->type != "Spacer"): ?>
<span class="optional"><?php echo JText::_('COM_CONTACT_OPTIONAL');?></span>
<?php endif; ?>
<?php echo $field->input;?></p>
<?php endif;?>
<?php endforeach;?>
<?php endif ?>
<?php endforeach;?>
<p><?php echo $this->form->getLabel('contact_message'); ?> <?php echo $this->form->getInput('contact_message'); ?></p>
<p>
<?php if ($this->params->get('show_email_copy')){ ?>
<?php echo $this->form->getLabel('contact_email_copy'); ?> <?php echo $this->form->getInput('contact_email_copy'); ?>
<?php } ?>
</p>
(I have added some indentions to make it more readable).
Now if you want to move recaptcha under the message box, the code should look this way:
- Code: Select all
<p class="contact-name"><?php echo $this->form->getLabel('contact_name'); ?> <?php echo $this->form->getInput('contact_name'); ?> </p>
<p class="contact-email"><?php echo $this->form->getLabel('contact_email'); ?> <?php echo $this->form->getInput('contact_email'); ?></p>
<p><?php echo $this->form->getLabel('contact_subject'); ?> <?php echo $this->form->getInput('contact_subject'); ?></p>
<p><?php echo $this->form->getLabel('contact_message'); ?> <?php echo $this->form->getInput('contact_message'); ?></p>
<?php //Dynamically load any additional fields from plugins. ?>
<?php foreach ($this->form->getFieldsets() as $fieldset): ?>
<?php if ($fieldset->name != 'contact'):?>
<?php $fields = $this->form->getFieldset($fieldset->name);?>
<?php foreach($fields as $field): ?>
<?php if ($field->hidden): ?>
<?php echo $field->input;?>
<?php else:?>
<p> <?php echo $field->label; ?>
<?php if (!$field->required && $field->type != "Spacer"): ?>
<span class="optional"><?php echo JText::_('COM_CONTACT_OPTIONAL');?></span>
<?php endif; ?>
<?php echo $field->input;?></p>
<?php endif;?>
<?php endforeach;?>
<?php endif ?>
<?php endforeach;?>
<p>
<?php if ($this->params->get('show_email_copy')){ ?>
<?php echo $this->form->getLabel('contact_email_copy'); ?> <?php echo $this->form->getInput('contact_email_copy'); ?>
<?php } ?>
</p>