Best way to collapse the width of a control

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Locked
MES5464
Posts: 94
Joined: Mon Aug 26, 2013

22 May 2014

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?

User avatar
Dmitry Kozlov
Site Admin
Posts: 1524
Joined: Thu Jun 07, 2012

23 May 2014

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;
}

MES5464
Posts: 94
Joined: Mon Aug 26, 2013

23 May 2014

So, this doesn't work on Plumsail Lookup fields.

MES5464
Posts: 94
Joined: Mon Aug 26, 2013

23 May 2014

It also doesn't work on date fields.

User avatar
Dmitry Kozlov
Site Admin
Posts: 1524
Joined: Thu Jun 07, 2012

27 May 2014

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;
}

User avatar
Dmitry Kozlov
Site Admin
Posts: 1524
Joined: Thu Jun 07, 2012

02 Jun 2014

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

User avatar
Dmitry Kozlov
Site Admin
Posts: 1524
Joined: Thu Jun 07, 2012

03 Jun 2014

Hello Adam,

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

Code: Select all

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

User avatar
Dmitry Kozlov
Site Admin
Posts: 1524
Joined: Thu Jun 07, 2012

03 Jun 2014

That worked! I forgot to mention that I was using the following before:


.text-metadata .ms-taxonomy

{

width: 250px !important;

}

User avatar
Dmitry Kozlov
Site Admin
Posts: 1524
Joined: Thu Jun 07, 2012

10 Jun 2014

Anyone know how to limit the width of a multi-line text field?

The above mentioned technics does not seem to work.

Thanks

User avatar
Dmitry Kozlov
Site Admin
Posts: 1524
Joined: Thu Jun 07, 2012

11 Jun 2014

Please, try the following solution:
viewtopic.php?f=1&p=372#p372

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 17 guests