1

I have 2 control : Check box and Choice (Radio Button). On Selecting check box , radio field should be enabled and on unchecked of check box , choice field should be disabled.

Can someone help with it!!!

Code as follows

<tr>
    <td width="190px" valign="top" class="ms-formlabel"><H3 class="ms-standardheader"><nobr>Survey Confirmation<span class="ms-formvalidation">
        <xsl:text xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" ddwrt:whitespace-preserve="yes" xml:space="preserve">   </xsl:text></span></nobr></H3>
    </td>
    <td width="400px" valign="top" class="ms-formbody">
        <xsl:variable name="FormField1Checked">
            <xsl:choose>
                <xsl:when test="@surveyconfirmation='1' or msxsl:string-compare(string(@surveyconfirmation),'Yes','','i')=0 or msxsl:string-compare(string(@surveyconfirmation),'True','','i')=0">true</xsl:when>
                <xsl:otherwise>false</xsl:otherwise>
            </xsl:choose>
        </xsl:variable>
        <asp:CheckBox runat="server" id="FormField1{$Pos}" text=" " checked="{$FormField1Checked}" __designer:bind="{ddwrt:DataBind('u',concat('FormField1',$Pos),'Checked','CheckedChanged','ID',ddwrt:EscapeDelims(string(@ID)),'@surveyconfirmation')}" />Yes
    </td>
</tr>                   
<tr>
    <td width="190px" valign="top" class="ms-formlabel">
        <H3 class="ms-standardheader"><nobr>No of Days</nobr>
        </H3>
    </td>
    <td width="400px" valign="top" class="ms-formbody">
        <SharePoint:formfield runat="server" id="ff28{$Pos}" controlmode="Display" fieldname="Survey_x0020_Confirmation_x0020_" __designer:bind="{ddwrt:DataBind('i',concat('ff28',$Pos),'Value','ValueChanged','ID',ddwrt:EscapeDelims(string(@ID)),'@Survey_x0020_Confirmation_x0020_')}"/>

    </td>                   
</tr>
3
  • what did you try? what error did you get? Which version of SP?
    – Steve B
    Jun 18, 2012 at 13:08
  • SP2010. I tried to do it using javascript but not able to do. Jun 19, 2012 at 4:40
  • not actually an answer, but you may try with customizing the list form with InfoPath. This will allow you to define custom rules, like enabling controls if a requirement is met. However, you will need the enterprise CAL licence (you did not specify the edition of SharePoint).
    – Steve B
    Jun 19, 2012 at 7:18

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.