By ardas on
Greetings,
Can anybody suggest how to properly output a form element with no BR tag after element label, so label and value will go on the same line. There was a problem with that in Drupal 4.6 .... It was not customizible - BR was hardcoded in form_element() function
Thanks.
Comments
For 4.7 you can override theme_form_element
While you can override theme_form_element, I see no generation of an HTML break and suspect it is more a question of css styling. If you look in drupal.css you will find
which should be the source of the 'break'. If you override this in styles.css (for the theme you are using) with
This will get you started. For text fields you will want to add
First line overrides the setting of width to 100% in drupal.css, the second makes it inline.
You may find the space between the label and form element too small after you do this so you may want to change the rule for '.form-item label' to include a setting for margin-right.
Okay. Thanks. But what if I
Okay. Thanks. But what if I need to have several textfields with break and several without them within one theme?
I currently see only one solution - ovverride all theme_[form_element] functions to add one more bool parameter and patch them to insert BR depending on that parameter.
Each text field as both a form id and field id
Each text field as both a form id and field id so you should be able to use those to restrict how the label shows up.
Also, I a pretty sure the theme function no longer inserts a break statement but replies on css rules.
Thanks a lot for your help.
Thanks a lot for your help.