Project:Better Exposed Filters
Version:7.x-3.0-beta1
Component:Code
Category:support request
Priority:normal
Assigned:Unassigned
Status:active

Issue Summary

Hello,

1.
I have a problem with the w3c validation. I become a lot of errors when I validate my page. Can you explain me how can I solve this?

messages:
Line 199, Column 152: Attribute multiple not allowed on element input at this point.
Line 199, Column 125: Duplicate attribute name.

2.
I need id's for my form-items can you explain me how can I create this?

at the moment:

<div class="form-item">
<input id="edit-field-haus-tid-98" type="checkbox" multiple="multiple" value="98" name="field_haus_tid[]">
<label class="option" for="edit-field-haus-tid-98">Haus</label>
</div>

so I need it:

<div id="edit-field-tid-98" class="form-item">
<input id="edit-field-haus-tid-98" type="checkbox" multiple="multiple" value="98" name="field_haus_tid[]">
<label class="option" for="edit-field-haus-tid-98">Haus</label>
</div>

you can find a link to my site on my profile page

kind regards
drew

Comments

#1

Hey,

if I have the display to "links" change, then I get the id and class as it need.

example:

<div id="edit-field-haus-tid-98" class="form-item">

Can you explain how I can use this function?

I'm not a programmer, so I hope you can help me.

kind regards
drew

#2

Component:Miscellaneous» Code
Assigned to:drew29» Anonymous

sorry I'm again. I meaning:

<div id="edit-haus-98-wrapper" class="form-item">
<label class="option" for="edit-haus-98">
<input id="edit-haus-98" class="haus" type="checkbox" value="98" name="haus[]">
Barrierefrei
</label>
</div>

ca you help me?

kind regards
drew

#3

Hello all,

I have found a code snippet but I don't how can I use this snippet for the better exposed filter.

<?php
/**
* Return a themed form element.
*
* Override here is to get a element ID on radios and checkboxes
*
* @param element
*   An associative array containing the properties of the element.
*   Properties used: title, description, id, required
* @param $value
*   The form element's data.
* @return
*   A string representing the form element.
*
* @ingroup themeable
*/
function phptemplate_form_element($element, $value) {
 
// This is also used in the installer, pre-database setup.
 
$t = get_t();

 
$output = '<div class="form-item"';
  if (!empty(
$element['#id'])) {
   
$output .= ' id="'. $element['#id'] .'-wrapper"';
  }
  else {
// if we can't get the #id from $element['#id'] just build it from $element['#name']
   
$id=explode("[value]", $element['#name']);
   
$output .= ' id="edit-'. preg_replace('/\[|\]|_/', '-', str_replace('][', '-', $id[0])) .'value-wrapper"';
  }
 
$output .= ">\n";
 
$required = !empty($element['#required']) ? '<span class="form-required" title="'. $t('This field is required.') .'">*</span>' : '';

  if (!empty(
$element['#title'])) {
   
$title = $element['#title'];
    if (!empty(
$element['#id'])) {
     
$output .= ' <label for="'. $element['#id'] .'">'. $t('!title: !required', array('!title' => filter_xss_admin($title), '!required' => $required)) ."</label>\n";
    }
    else {
     
$output .= ' <label>'. $t('!title: !required', array('!title' => filter_xss_admin($title), '!required' => $required)) ."</label>\n";
    }
  }

 
$output .= " $value\n";

  if (!empty(
$element['#description'])) {
   
$output .= ' <div class="description">'. $element['#description'] ."</div>\n";
  }

 
$output .= "</div>\n";

  return
$output;
}
?>

hope you can help me

kind regards
drew

#4

Hej Hej,

I have not found a solution. can someone help me to solve this problem?

. 'name="' . $element['#name'] . '[]" '    // brackets are key -- just like select

kind regards
drew

#5

Title:W3C validation errors and create form-item ID» W3C validation errors

Ok,

now I have comment out these line

. 'name="' . $element['#name'] . '[]" '    // brackets are key -- just like select

and a lot of errors are corrected but the multiple error still the same.

can you help me to solve it?

kind regards
drew

nobody click here