Search code examples
asp.netxsltxpathsharepoint-2007sharepoint-designer

Sharepoint FormField default value?


Is it possible to add default values to a sharepoint FormField object?

Here is my code:

    <SharePoint:formfield runat="server" id="ff8{$Pos}" ControlMode="Edit" FieldName="Body" ItemId="{@ID}" __designer:bind="{ddwrt:DataBind('u',concat('ff8',$Pos),'Value','ValueChanged','ID',ddwrt:EscapeDelims(string(@ID)),'@Body')}" />
    <SharePoint:fielddescription runat="server" id="ff8description{$Pos}" FieldName="Body" ControlMode="Edit" />

Basically, I want the form field's default value to be more than just the Body parameter (perhaps 2 parameters and some custom text). Is this possible?

(Also, I know you can substitute the SP form Field with an ASP TextBox, but I'm running into problems with that--specifically, the text box doesn't support rich text, and the post-back doesn't preserve line breaks.)

Thanks in advance!


Solution

  • It looks like I was able to solve this. Other forums had me using an ASP Text box and writing code behind in C#, but it's really not necessary if you use a Sharepoint:InputFormTextBox instead.

    <SharePoint:InputFormTextBox ID="ff8{$Pos}" RichText="true" text="{concat(@Body, "CustomText", @secondparameter)}" RichTextMode="FullHtml"  TextMode="MultiLine" runat="server" __designer:bind="{ddwrt:DataBind('u',concat('ff8',$Pos),'Text','TextChanged','ID',ddwrt:EscapeDelims(string(@ID)),'@Body')}" Width="99%" Rows="10"/>
    

    If this was an obvious solution, please forgive my ignorance. This is new territory for me.