Révision 8c72e82a
Ajouté par Assos Assos il y a environ 7 ans
drupal7/sites/all/modules/webform/components/textfield.inc | ||
---|---|---|
19 | 19 |
'extra' => array( |
20 | 20 |
'width' => '', |
21 | 21 |
'maxlength' => '', |
22 |
'minlength' => '', |
|
22 | 23 |
'field_prefix' => '', |
23 | 24 |
'field_suffix' => '', |
24 | 25 |
'disabled' => 0, |
... | ... | |
126 | 127 |
'#weight' => 2, |
127 | 128 |
'#parents' => array('extra', 'maxlength'), |
128 | 129 |
); |
130 |
$form['validation']['minlength'] = array( |
|
131 |
'#type' => 'textfield', |
|
132 |
'#title' => t('Minlength'), |
|
133 |
'#default_value' => $component['extra']['minlength'], |
|
134 |
'#description' => t('Minimum length of the textfield value. The component may still be empty unless it is set as Required.'), |
|
135 |
'#size' => 5, |
|
136 |
'#maxlength' => 10, |
|
137 |
'#weight' => 3, |
|
138 |
'#parents' => array('extra', 'minlength'), |
|
139 |
); |
|
129 | 140 |
return $form; |
130 | 141 |
} |
131 | 142 |
|
... | ... | |
179 | 190 |
if ($component['extra']['maxlength'] > 0) { |
180 | 191 |
$element['#maxlength'] = $component['extra']['maxlength']; |
181 | 192 |
} |
193 |
if ($component['extra']['minlength'] > 0) { |
|
194 |
$element['#minlength'] = $component['extra']['minlength']; |
|
195 |
} |
|
182 | 196 |
|
183 | 197 |
if (isset($value[0])) { |
184 | 198 |
$element['#default_value'] = $value[0]; |
Formats disponibles : Unified diff
Weekly update of contrib modules