• Home
  • Blog
  • Joomla 2.5 Contact Form Correcting bootstrap classes for input and label

Joomla 2.5 Contact Form Correcting bootstrap classes for input and label

To correct the classes in the contact form for correct use with bootstrap, in the override default_form.php add the following:

<?php
$this->form->setFieldAttribute('contact_name', 'class', 'form-control');
$this->form->setFieldAttribute('contact_name', 'labelclass', 'control-label');
$this->form->setFieldAttribute('contact_email', 'class', 'form-control');
$this->form->setFieldAttribute('contact_email', 'labelclass', 'control-label');
$this->form->setFieldAttribute('contact_subject', 'class', 'form-control');
$this->form->setFieldAttribute('contact_subject', 'labelclass', 'control-label');
$this->form->setFieldAttribute('contact_message', 'class', 'form-control');
$this->form->setFieldAttribute('contact_message', 'labelclass', 'control-label');
$this->form->setFieldAttribute('contact_email_copy', 'class', 'form-control');
$this->form->setFieldAttribute('contact_email_copy', 'labelclass', 'control-label');
?>

joomla, contact form, class, bootstrap

Social