Hi friends!

I'm developing a form in wich i have several fields. I have the fields ordered up to down.
That's done automatically by Drupal through the 'weight' parameter. My doubt is how can
i do to get the fields in the position i want. I mean, if i want to show the fields in a table
structure, how can i do it? Or, if i want to show one field in a row, two fields in another row
and another field in another row, how can i do it?

Thank's in advance!!!!!!

Comments

kstellana’s picture

You just need a nice structure and some css.

Or if you want to make it the good way you have to make a theme and do something like... http://drupal.org/node/47582

jesusDrupal’s picture

Hi kstellana:

I've been trying to include a background image through css as you suggested. My problem now is that
my form has to tabs, one is to show data and the other is to add a new register. I want the
background image in each case to be different. How can i do it? Through Fierbug i found the div name
of the container but i can't asign a different image to each tab because the background seems to
be the same. If you can help me.........

Thank's anyway!!!!

kstellana’s picture

well, that is no problem. just check the #attributes:

#attributes

Used by: button, checkbox, checkboxes, date, fieldset, file, form, markup, password, radio, radios, select, submit, textarea, textfield, weight

Description: Additional HTML attributes, such as 'class' can be set using this mechanism.

Values: Any HTML attribute not covered by other properties, e.g. class (for control types), enctype (for forms).

Usage example (search.module):

$form['#attributes'] = array('class' => 'search-form');

The # is mandatory before property names.
?>

As seen in:
http://api.drupal.org/api/file/developer/topics/forms_api_reference.html/6

Create a new class with it and then customize it the way you want with css.

Still, I think it'd be better for you to check the post of the form-tables I told you before

jesusDrupal’s picture

Ok, i'll try to follow your suggestions.
Thanks for the quick help!!!!!

nazroll’s picture

you can also try an use hook_form_alter...

jesusDrupal’s picture

It's another posibility.

Thank's!