Page 1 of 1

Best way to collapse the width of a control

Posted: 22 May 2014
by MES5464
I find that the controls on SPForms are wide. I would like to shink the width of controls for thinks like State and Postal Code. I see where I can control the label width, but what is the best way to set the control width?

Re: Best way to collapse the width of a control

Posted: 23 May 2014
by Dmitry Kozlov
Please, assign CSS-class to text fields which you wish to make smaller, e.g. 'small-textbox' and define it in CSS-editor following way:

Code: Select all

.small-textbox .ms-long {
  width: 100px;
}

Re: Best way to collapse the width of a control

Posted: 23 May 2014
by MES5464
So, this doesn't work on Plumsail Lookup fields.

Re: Best way to collapse the width of a control

Posted: 23 May 2014
by MES5464
It also doesn't work on date fields.

Re: Best way to collapse the width of a control

Posted: 27 May 2014
by Dmitry Kozlov
Here are definitions of CSS-classes for Cross-site Lookup and Date fields:

Code: Select all

/* Cross-site Lookup field */
.small-lookup .plumsail-csl-textbox {
	width: 200px !important;
}

/* Date field */
.small-datepicker input[type='text'] {
	width: 100px;
}

Re: Best way to collapse the width of a control

Posted: 02 Jun 2014
by Dmitry Kozlov
How about Managed MetaData fields? I can get the text field to resize but the MetaData icon at the end stays in its same position when I view the form.

Example:

Image

Re: Best way to collapse the width of a control

Posted: 03 Jun 2014
by Dmitry Kozlov
Hello Adam,

The CSS definition is the same as for the text boxes:

Code: Select all

.small-metadata .ms-long {
    width: 100px;
}

Re: Best way to collapse the width of a control

Posted: 03 Jun 2014
by Dmitry Kozlov
That worked! I forgot to mention that I was using the following before:


.text-metadata .ms-taxonomy

{

width: 250px !important;

}

Re: Best way to collapse the width of a control

Posted: 10 Jun 2014
by Dmitry Kozlov
Anyone know how to limit the width of a multi-line text field?

The above mentioned technics does not seem to work.

Thanks

Re: Best way to collapse the width of a control

Posted: 11 Jun 2014
by Dmitry Kozlov
Please, try the following solution:
viewtopic.php?f=1&p=372#p372