Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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.

share|improve this question
add comment

2 Answers

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 + " *";
        })
}
share|improve this answer
    
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 Apr 26 '13 at 19:10
    
the CSS to expand it? –  David Lozzi Apr 26 '13 at 19:12
    
Yes, that's what I'd be looking for I suppose. I didn't realize it would be CSS though. –  Alex Apr 26 '13 at 19:22
    
As I understood, he wants a multi-line textbox instead of a single line.. @Alex correct me if I am wrong... –  Arsalan Adam Khatri Apr 27 '13 at 22:52
    
That is correct! –  Alex Apr 29 '13 at 2:45
show 1 more comment

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.

share|improve this answer
    
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 Apr 29 '13 at 2:48
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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