I am attempting to have a field that is set to ControlMode="Edit"
by default be conditional to be set to ControlMode="Display"
based on the value that is set to default above it.
For example: [Field1] is populated by a previous process to either "Yes" or "No".
For [Field2] I would like to to be ControlMode="Edit"
if [Field1] is set to "Yes" and ControlMode="Display"
if [Field1] is set to "No". I have tried the following:
<script type="text/javascript">
if ("ff1"="Yes")
{ <td width="400px" valign="top" class="ms-formbody">
<SharePoint:FormField runat="server" id="ff73{$Pos}" ControlMode="Display" FieldName="EMail_x0020_Address" __designer:bind="{ddwrt:DataBind('u',concat('ff73',$Pos),'Value','ValueChanged','ID',ddwrt:EscapeDelims(string(@ID)),'@EMail_x0020_Address')}"/>
<SharePoint:FieldDescription runat="server" id="ff73description{$Pos}" FieldName="EMail_x0020_Address" ControlMode="Display"/>
</td>
}
ELSE
{<td width="400px" valign="top" class="ms-formbody">
<SharePoint:FormField runat="server" id="ff73{$Pos}" ControlMode="Edit" FieldName="EMail_x0020_Address" __designer:bind="{ddwrt:DataBind('u',concat('ff73',$Pos),'Value','ValueChanged','ID',ddwrt:EscapeDelims(string(@ID)),'@EMail_x0020_Address')}"/>
<SharePoint:FieldDescription runat="server" id="ff73description{$Pos}" FieldName="EMail_x0020_Address" ControlMode="Edit"/>
</td>
}
I have placed this within the table.
Could anyone help me understand what I am doing wrong and how I can overcome this issue?