locked
Change Formfield Width RRS feed

  • Question

  • I have couple look up columns in my list. There is only 2 characters in the source columns. However, the drop-down field is about 200px in my custom form. I would like to adjust these drop-down fields' width to 50-80px. I have googled this subject and try different display sizes and add div with custom style. However, they do not work for me. I just wonder if anyone has a solution other than using javascript (do not like format screen every time open the page). Many thanks.   
    Tuesday, May 3, 2011 9:57 PM

Answers

  • Thank you for your response. These field are SharePoint FormField. But they are lookup fields and width setting is not avaliable.  What I endup  was another way, format them as dropdown list fields. Then create lookup source lists as datasource for binding the dropdown fields.
    • Marked as answer by eg10013 Thursday, May 5, 2011 1:26 PM
    Thursday, May 5, 2011 1:25 PM

All replies

  • Hi,

     

    According to your description, I suggest that you should format the fileds to be SharePoint: FormField controls, and now you can change the size of these those controls. For more information, please refer to this blog about Modify the lengths of List Form Fields:

    http://blogs.msdn.com/b/sharepointdesigner/archive/2008/01/25/modify-the-lengths-of-list-form-fields.aspx

     

    Best Regards
    David Hu

     

    Thursday, May 5, 2011 1:31 AM
  • Thank you for your response. These field are SharePoint FormField. But they are lookup fields and width setting is not avaliable.  What I endup  was another way, format them as dropdown list fields. Then create lookup source lists as datasource for binding the dropdown fields.
    • Marked as answer by eg10013 Thursday, May 5, 2011 1:26 PM
    Thursday, May 5, 2011 1:25 PM
  • Wow, that is exceptionally shortsighted.

    Microsoft presents SP as a mature tool to develop collaboration sites and says that you can use an external SQL DB, yet every time people try to connect this using share point tools it fails. Maybe you guys need to change the marketing and say that it is great if you use VS 2010 along with custom built .aspx pages and you build your own object, SQL strings and while you are at it, just skip using share point and build your own website using someone else's tools.

    Sunday, June 24, 2012 3:28 PM
  • Override the style that SharePoint uses to format the length of the dropdownbox.

    Using SP2010, I had a quick look and found it to be using "ms-lookuptypeintextbox".

    using css, simply override ms-lookuptypeintextbox.width to whatever width you want.

    .ms-lookuptypeintextbox{

    width: 80px;

    }

    Its really is that easy, unless I misunderstood what you are doing.

    Monday, July 15, 2013 12:31 PM