0

Can anyone suggest a way to make the "specify your own value" text box larger in the Edit Form of a list item's Choice column? I would like to make it look more like a multi-line text field type, since some of these fill-in entries can be quite long and the end-user wants to see the entirety of the text they type in. Specifically, I am referring to a Choice field that has "allow fill in choices" enabled:

enter image description here

The first thing I can think of is to maybe use a CEWP with javascript to accomplish this, but not quite sure how to expand the box yet.

2 Answers 2

1

Avoid manipulating a page via scripts loaded with CEWPs. It's messy and insecure and can be broken easily by any user with edit access to the page. Load those scripts in the master page or the page layout, if you need them. And yes, you can make the text box wider with CSS, but you won't be able to convert it to a multi-line text field. That's another data type and beyond the means of CSS. Use the developer tools of your browser to identify the CSS applied to the text box and override it with custom CSS.

1
  • Thank you, and I understand that this is a best practice, but maybe you will agree that sometimes this cannot be avoided for some project requirements. If it is in the master page, it will affect all sites, no? This is a requirement for only one page, which is a custom implementation for a project. Also, we already have the infrastructure of permissions and security on our pages so the list of individuals with "edit" access to all our pages can be counted on one hand, which includes me.
    – Alex
    Commented Apr 29, 2013 at 2:48
0

Yeah, you're on the right path. Use a CEWP, and if you can grab the control, you should be all set to apply css to resize it as needed. Here's a little cheat I use. These functions return the TD cells from the table. Using getFieldCcontrolCell("Field Name"), you can then search it for the textbox and work it from there.

function getFieldControlCell(fieldDisplayName){
        return getFieldLabelCell(fieldDisplayName).next();
}

function getFieldLabelCell(fieldDisplayName){
        return $(".ms-formlabel").filter(function(index){
                return $(this).find("nobr").text() == fieldDisplayName || $(this).find("nobr").text() == fieldDisplayName + " *";
        })
}
6
  • Thanks, I know how to get an element on the page (as well as this text box), but my question is more of how to do the expanding itself.
    – Alex
    Commented Apr 26, 2013 at 19:10
  • the CSS to expand it? Commented Apr 26, 2013 at 19:12
  • Yes, that's what I'd be looking for I suppose. I didn't realize it would be CSS though.
    – Alex
    Commented Apr 26, 2013 at 19:22
  • As I understood, he wants a multi-line textbox instead of a single line.. @Alex correct me if I am wrong... Commented Apr 27, 2013 at 22:52
  • That is correct!
    – Alex
    Commented Apr 29, 2013 at 2:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.