I Created some cck field and set it inline in my custom.css file, but i have problem in size of input field which it always in default size.

I have set

    '#size' => 10,
    '#maxlength' => 10

in my field. but it not works, input field size always displayed in default size.

I attached image to describe my problem, so you can see the different input field size in colourise and garland. I want my input size like in garland

Please I realy realy need help, i have spend alot of time to try with css but has not been get a result.
I really appreciate the help you provide

Thaks you, for all of you

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Deepika.chavan’s picture

FileSize
24.96 KB

Hi,
I have created two cck fields namely 'First name(name- field_fname)' and 'Last name(name- field_lname)' on my localsite. So I got css Id attributes like 'edit-field-fname-0-value' and 'edit-field-lname-0-value' respectively for of both fields.

Added following css to change the width of the input fields :

#edit-field-fname-0-value, #edit-field-lname-0-value {
  width: 30%;
}

Please try above css code by using id of of your fields.

If you want to set the maximum number of characters for particular field, you can set "Maximum length: " in global setting of that field.

Rgrds,

Deepika.Chavan

yashadev’s picture

Status: Active » Closed (fixed)

You need to use the exact field id, as Deepika.chavan has indicated. In addition, if you want to change the field width, you should be using the width property rather than size and maxlength

Closing since the issue is 2 year old and there has been no activity since then.