DisableInputFieldLabel=true not working, unable to hide field label on customised EditForm.aspx RRS feed

  • Question

  • Hi, I have created a custom EditForm.aspx by inserting a Custom List Form, the field labels are rendering in SPDesigner and through the browser, I've tried to use DisableInputFieldLabel="True" however this doesn't make any difference. How do I remove the field labels?
    Monday, May 25, 2009 12:07 AM


All replies

  • When you have a custom form with a DVWP on it, the form labels become hard-wired text in their own tags in the XSL. You'll need to go into the DVWP and delete the labels yourself.

    Marc - Sympraxis Consulting LLC - Marc's Blog
    Monday, May 25, 2009 1:42 AM
  • Thanks Marc,

    So how do I go in to the DVWP and remove the labels, I've opened the aspx file in both SP Designer and Visual Studio and can't work out where to do it. This is the code from one of the fields:

    <td width="400px" valign="top" class="ms-formbody">
    <SharePoint:FormField runat="server" id="ff1{$Pos}" ControlMode="Edit" FieldName="Title" __designer:bind="
    {ddwrt:DataBind('u',concat('ff1',$Pos),'Value','ValueChanged','ID',ddwrt:EscapeDelims(string(@ID)),'@Title')}" TabIndex="1"/> <SharePoint:FieldDescription runat="server" id="ff1description{$Pos}" FieldName="Title" ControlMode="Edit" /> </td>

    All help appreciated.
    Monday, May 25, 2009 4:00 AM
  • Paul:

    I just created a simple custom form.  Below, I'm showing the code for the row where the Title column is displayed.  As you can see, the label for the field is in the first TD.  You can alter that in any way you see fit.


    	<td width="25%" class="ms-vb">
    		<b>Title<span class="ms-formvalidation"> *</span>:</b>
    	<td width="75%" class="ms-vb">
    		<SharePoint:FormField runat="server" id="ff1{$Pos}" ControlMode="Edit" FieldName="Title" ItemId="{@ID}" __designer:bind="{ddwrt:DataBind('u',concat('ff1',$Pos),'Value','ValueChanged','ID',ddwrt:EscapeDelims(string(@ID)),'@Title')}"/>
    		<SharePoint:FieldDescription runat="server" id="ff1description{$Pos}" FieldName="Title" ControlMode="Edit"/>

    Marc D Anderson - Sympraxis Consulting LLC - Marc D Anderson's Blog
    Tuesday, May 26, 2009 12:26 AM
  • Hi Marc,

    Sorry, guess I wasn't clear enough, it's not the field lable to the left of the input, it's a field label that wraps around the input, I think it may also be known as the field container?? I've looked at the code of the rendered page and for some reason this DIV code is being added in:
    <div align="left" class="ms-formfieldcontainer">
    <div class="ms-formfieldlabelcontainer" nowrap="nowrap">
    <span class="ms-formfieldlabel" nowrap="nowrap">Request Title</span></div><div class="ms-formfieldvaluecontainer"><span dir="none">
    I cannot work out how to prevent this container from rendering, it doesn't render on the NewForm.aspx which I have also used a DVWP in. Here's a link to a screenshot of what I mean:


    Tuesday, May 26, 2009 1:25 AM
  • Interesting.  Is that container visible to regular users?

    I've seen this once, I think, but I can't remember what I did to get rid of it.

    Marc D Anderson - Sympraxis Consulting LLC - Marc D Anderson's Blog
    Tuesday, May 26, 2009 1:48 AM
  • Yep, everyone can see the container. I've searched through every property and setting I can, done plenty of Google searches but can't seem to find anything about it.
    Tuesday, May 26, 2009 4:26 AM
  • Have you tried just starting from scratch and building up your page again?  It's got to be a setting somewhere that you haven't spotted.  I'm betting that you've already tried this, but hey, why not suggest it?

    Marc D Anderson - Sympraxis Consulting LLC - Marc D Anderson's Blog
    Tuesday, May 26, 2009 12:32 PM
  • Yep have done that a couple of times, I've come across this on other lists and other sites also so don't know if there's something peculiar about our install as it doesn't seem to be a general issue considering there's no info on the net. For now I've given up on custom edit forms and will use the standard form with some fields added and hidden until I can find a solution somewhere. Thanks.
    Wednesday, May 27, 2009 11:24 PM
  • Paul:

    The only other thing that comes to mind is to check your rev of SharePoint and think about getting up to date.  Here's a post that should help you figure out where you are currently:

    Sorry we haven't solved this one...

    Marc D Anderson - Sympraxis Consulting LLC - Marc D Anderson's Blog
    Thursday, May 28, 2009 12:48 AM
  • I'm facing the same issue, is there anyone found a solution?
    Tuesday, June 30, 2009 4:54 AM
  • Hi all,

    I had the same problem and I added two styles to the editform:

    <style type=""text/css"">
    .ms-formfieldlabelcontainer {
    	display: none;
    .ms-formfieldvaluecontainer {
    	border: 0px;
    That did the trick for me. Hides both the label and the border around the input control.

    • Proposed as answer by asembler Wednesday, November 25, 2009 8:32 AM
    • Marked as answer by Mike Walsh FIN Friday, January 7, 2011 4:51 PM
    Tuesday, September 22, 2009 12:48 PM
  • In my case FormFields are displayed in a customized GridView to display an ordered subset of item fields. Fortunately I solve the problem by setting DisableInputField in code behind as follows:

    void grdMeta_RowCreated(object sender, GridViewRowEventArgs e)
        FormField ff = (FormField)e.Row.FindControl("ff");
        if (ff == null) return;
        ff.FieldName = ((IdeaStructureRow)e.Row.DataItem).Title;
        ((BaseFieldControl)ff.Controls[0]).DisableInputFieldLabel = true; // MOSS bug workaround


    Tuesday, December 15, 2009 4:35 PM
  • You should not use DisableInputFieldLabel="True" but i suggest you to set ControlMode="Display" for your field that would automatically read only.

    You can check in my blog at http://menetes.blogspot.com/2011/01/disableinputfieldlabel-property-not.html


    Hope that would help you.

    Friday, January 7, 2011 4:20 PM