0

I have an SharePoint formular and I want to add same control effect to it : when I click in radio button another button become enable , like this:

enter image description here

I want the "ajouter"button desable at the first and became enable when I click on "non".

this is the code :

<tr>
                    <td width="190px" valign="top" class="ms-formlabel">
                        <H3 class="ms-standardheader">
                            <nobr>Lien </nobr>
                        </H3>
                    </td>
                    <td width="400px" valign="top" class="ms-formbody">
                        <SharePoint:FormField runat="server" id="ff11{$Pos}" ControlMode="New" FieldName="Lien_x0020_avec_x0020_courrier_x" __designer:bind="{ddwrt:DataBind('i',concat('ff11',$Pos),'Value','ValueChanged','ID',ddwrt:EscapeDelims(string(@ID)),'@Lien_x0020_avec_x0020_courrier_x')}"/>
                        <SharePoint:FieldDescription runat="server" id="ff11description{$Pos}" FieldName="Lien_x0020_avec_x0020__x" ControlMode="New"/>
                    </td>
                </tr>
                <tr>
                    <td width="190px" valign="top" class="ms-formlabel">
                        <H3 class="ms-standardheader">
                            <nobr>Référence </nobr>
                        </H3>
                    </td>
                    <td width="400px" valign="top" class="ms-formbody">
                        <SharePoint:FormField runat="server" id="ff12{$Pos}" ControlMode="New" FieldName="R_x00e9_f_x00e9_rence_x0020_cour0" __designer:bind="{ddwrt:DataBind('i',concat('ff12',$Pos),'Value','ValueChanged','ID',ddwrt:EscapeDelims(string(@ID)),'@R_x00e9_f_x00e9_rence_x0020_cour0')}"/>
                        <SharePoint:FieldDescription runat="server" id="ff12description{$Pos}" FieldName="R_x00e9_f_x00e9_rence_x0020_" ControlMode="New"/>
                    </td>
                </tr>

1 Answer 1

0

two ways to achieve this:

  1. server-side code: your Buttons should have the AutoPostBack property = true. This will effect that the page will be reloaded after a click event. Then you have to write c#-code in the PageLoad-event of your page to set the behaviour you'd like to have.

  2. client-side code: your buttons have got to implement the onClientClick event. Therein you have to place JavaScript code doing the enabling stuff.

Both Solutions are not easy for beginners. But cascading effects like this cannot be achieved by GUI or Out-Of-the-Box.

2
  • thanks Celophysis, you may help me.If you have any link for JavaScript code .
    – Imen Turki
    Oct 9, 2014 at 8:02
  • search for "sharepoint javascript cascading" in Google & Co. So you will easily find some examples.
    – Celophysis
    Oct 9, 2014 at 9:02

This site is temporarily in read-only mode and not accepting new answers.

Not the answer you're looking for? Browse other questions tagged .