summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorGábor Hojtsy <gabor@hojtsy.hu>2007-08-09 10:43:03 +0000
committerGábor Hojtsy <gabor@hojtsy.hu>2007-08-09 10:43:03 +0000
commitdb5311d144d067ae1774b5cf6b395c77ac209a6c (patch)
treec7600dc9dc2d0bdd395117dcfbe24676328b242a /includes
parent323fa356bd2137f873386191a061bdfaeffa7ae7 (diff)
downloadbrdo-db5311d144d067ae1774b5cf6b395c77ac209a6c.tar.gz
brdo-db5311d144d067ae1774b5cf6b395c77ac209a6c.tar.bz2
#85208 by neclimdul and bjaspan (slightly modified): if no maxlength was specified, do not generate an empty HTML attribute
Diffstat (limited to 'includes')
-rw-r--r--includes/form.inc5
1 files changed, 3 insertions, 2 deletions
diff --git a/includes/form.inc b/includes/form.inc
index 5ab3d885f..6001c51c8 100644
--- a/includes/form.inc
+++ b/includes/form.inc
@@ -1698,7 +1698,8 @@ function theme_token($element) {
* A themed HTML string representing the textfield.
*/
function theme_textfield($element) {
- $size = $element['#size'] ? ' size="'. $element['#size'] .'"' : '';
+ $size = empty($element['#size']) ? '' : ' size="'. $element['#size'] .'"';
+ $maxlength = empty($element['#maxlength']) ? '' : ' maxlength="'. $element['#maxlength'] .'"';
$class = array('form-text');
$extra = '';
$output = '';
@@ -1714,7 +1715,7 @@ function theme_textfield($element) {
$output .= '<span class="field-prefix">'. $element['#field_prefix'] .'</span> ';
}
- $output .= '<input type="text" maxlength="'. $element['#maxlength'] .'" name="'. $element['#name'] .'" id="'. $element['#id'] .'" '. $size .' value="'. check_plain($element['#value']) .'"'. drupal_attributes($element['#attributes']) .' />';
+ $output .= '<input type="text"'. $maxlength .' name="'. $element['#name'] .'" id="'. $element['#id'] .'"'. $size .' value="'. check_plain($element['#value']) .'"'. drupal_attributes($element['#attributes']) .' />';
if (isset($element['#field_suffix'])) {
$output .= ' <span class="field-suffix">'. $element['#field_suffix'] .'</span>';