Chox’s Blog

Chox juga mau belajar nge-blog

This form was customized not working with attachment – SharePoint MOSS 2007

The title of this post is an alert pop up, when we used a customized new/edit form then want add some attachments.

So for you that want to create customized form that include that attachment function, you should add some codes to make it works.

1. Find this codes:

<xsl:template name=”dvt_1″>

<xsl:variable name=”dvt_StyleName”>ListForm</xsl:variable>

<xsl:variable name=”Rows” select=”/dsQueryResponse/Rows/Row”/>

<table border=”0″ width=”100%”>

<xsl:call-template name=”dvt_1.body”>

<xsl:with-param name=”Rows” select=”$Rows”/>

</xsl:call-template>

</table>

</xsl:template>

2. Append with this codes

<xsl:template name=”dvt_1″>

<xsl:variable name=”dvt_StyleName”>ListForm</xsl:variable>

<xsl:variable name=”Rows” select=”/dsQueryResponse/Rows/Row”/>

<div>

<span id=”part1″>

<table border=”0″ width=”100%”>

<xsl:call-template name=”dvt_1.body”>

<xsl:with-param name=”Rows” select=”$Rows”/>

</xsl:call-template>

</table>

</span>

<SharePoint:AttachmentUpload runat=”server” ControlMode=”Edit“/>

<SharePoint:ItemHiddenVersion runat=”server” ControlMode=”Edit“/>

</div>

</xsl:template>

note : change the red color with New if you used for New Page Form,

or Edit if you used for Edit Page Form

3. Locate this following code

<xsl:if test=”$dvt_1_automode = ’1′” ddwrt:cf_ignore=”1″

4. Add this following code above the code of point #3

<tr id=”idAttachmentsRow”>

<td nowrap=”true” valign=”top” class=”ms-formlabel” width=”20%”>

<SharePoint:FieldLabel ControlMode=”Edit” FieldName=”Attachments” runat=”server”/>

</td>

<td valign=”top” class=”ms-formbody” width=”80%”>

<SharePoint:FormField runat=”server” id=”AttachmentsField” ControlMode=”Edit”

FieldName=”Attachments” __designer:bind=”{ddwrt:DataBind(‘u’,'AttachmentsField’,'Value’

,’ValueChanged’,'ID’,ddwrt:EscapeDelims(string(@ID)),’@Attachments’)}”/>

<script>

var elm = document.getElementById(“idAttachmentsTable”);

if (elm == null || elm.rows.length == 0)

document.getElementById(“idAttachmentsRow”).style.display=’none’;

</script> </td>

</tr>

note :* change the red color with New if you used for New Page Form, or Edit if you used for Edit Page Form

* find __designer:bind=”{ddwrt:DataBind(‘u‘ …. and change to ‘i’ for New Page Form or ‘u’ for Edit Page Form

Source : http://support.microsoft.com/default.aspx?scid=kb;en-us;953271&sd=rss&spid=11373

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.