Suddenly it was working in RC2 but not in 3.0 release.

Field type="email" is not rendered properly as it is missing in function _bootstrap_process_input (theme/process.inc). I would submit a patch, but structural endeavour: where to place it!
- it is HTML5 and not used by D7 core
- spotted it in webform module output, so we could create 'webform' section (as it is done for elements module), but pretty sure other modules might use that HTML5 compliant field as well (shall ther be 'HTML5' section)?

Something like this:

/**
 * Process input elements.
 */
function _bootstrap_process_input(&$element, &$form_state) {
  // Only add the "form-control" class for specific element input types.
  $types = array(
    // Core.
    'password',
    'password_confirm',
    'select',
    'textarea',
    'textfield',
    // HTML5.
    'email',
    // Elements module.
    'emailfield',
    'numberfield',
    'rangefield',
    'searchfield',
    'telfield',
    'urlfield',
  );
  if (!empty($element['#type']) && (in_array($element['#type'], $types) || ($element['#type'] === 'file' && empty($element['#managed_file'])))) {
    $element['#attributes']['class'][] = 'form-control';
  }
  return $element;
}
CommentFileSizeAuthor
#2 emailfield-2145515-8220873.patch398 bytesbetarobot

Comments

betarobot’s picture

Oh snap. Shame on me. That's exactly webform module issue. The affected field type is:
webform_email

betarobot’s picture

StatusFileSize
new398 bytes
Michsk’s picture

Status: Active » Reviewed & tested by the community

works.

wundo’s picture

Committed ;)

wundo’s picture

Status: Reviewed & tested by the community » Fixed
aeremeev’s picture

Thank you!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

raj45’s picture

I just bumped into this problem, using Webform 7.x-4.2 and Bootstrap 7.x-3.0, and I can confirm that the patch works, and makes the e-mail-address field render correctly. So it seems like it hasn't been committed yet?

betarobot’s picture

It was committed to 7.x-3.x-dev version. There was no full releases since then yet.

raj45’s picture

I see, thanks for clarifying!

raj45’s picture

Actually, is it time to release again? Last release was a while ago, 2013-Nov-17.

heylookalive’s picture

+1 for a stable release please :) really enjoying working with this theme by the way!

TheThemerist’s picture

Sorry, I know this is a closed issue, but for those looking for a quick, valid work around without applying a patch or while waiting for it to be included in a stable release of Bootsatrap Theme, the following line in your theme's LESS files will solve it in the short term:

.form-email{
  .form-control;
}

(Basically just using 'form-control' as a mixin, so that 'form-email' inherits all it styling properties.)

mesch’s picture

In the same spirit of #13, another solution is to alter the form and add the class. I only had one such field in one form so this was a quick and easy solution.

/**
 * Implements hook_form_FORM_ID_alter
 */
function [theme_name]_form_[form_id]_alter(&$form, &$form_state) {
  // Add the form-control class to the field.
  $form['submitted']['contact_information']['e_mail']['#attributes']['class'][] = 'form-control';  
}

Edit: Actually, this can be done via the UI via the component instance settings by adding a css class.

raj45’s picture

Thanks for sharing your very simple solution mesch! (#14)
To others: add form-control in the CSS Classes field at the bottom of the e-mail-address component and all is well.

simone960’s picture

Thanks @raj45 (#15). Simplest solution by just adding the class "form-control" to the field.