I am using Zen theme. I have a problem of putting my form fields inline even though I have configured them this way. I want to be able to do this for the registration form and also node forms. Any suggestions

Comments

nevets’s picture

What do you mean by "even though I have configured them this way"? Have you add css rules to style.css to make the form fields inline? And by "form fields inline" do you mean label and input field on same line.

electronicmonkey’s picture

.... I mean label and input field on same line.

nevets’s picture

I added the following to the themes styles.css file and it should help you get going

.form-item label {
  display:inline;
}

.node-form .form-text {
  display:inline;
  width:auto;
}

It is only a starting point since the second line only applies to text fields and you may want to apply other input types.

electronicmonkey’s picture

Sad to say it never worked

vinayras’s picture

Hi,

Thanks for the CSS tips - it works fine - and yes, it is a starting point. I further worked on it and now i have this,

.form-item label {
display: block; /* block float the labels to left column, set a width */
float: left;
width: 150px;
padding: 1px;
margin: 5px 0 0; /* set top margin same as form input - textarea etc. elements */
text-align: right;

}

.node-form .form-text {
display:inline;
width:auto;
}

This works fine for me.

Vinay Yadav
PHP / Drupal Developer
http://www.vinayras.com

www.eDrupal.com - Indian Drupal Community

macrodesign’s picture

subscribe

rohanchopra1’s picture

Its right.

ajay1kumar1’s picture

Append template.php

Add
function YOURTHEMENAME_form_element($element, $value) {
$output = '

'."\n";
$required = !empty($element['#required']) ? '*' : '';

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

$output .= " $value

< ajay /table>\n";

if (!empty($element['#description'])) {
$output .= '


'. $element['#description'] ."

\n";
}

$output .= "

\n";

return
$output;
}

Hope this will show you a tabulated form
Note : Remove all "ajay" text before use.
Kind regards
Ajay singh rathore
Netlink

ropaolle’s picture

Sub