title: Need jquery code to disable Drop downs and people pickers when a option in dropdown is selected in sharepoint
body: <p>I am working with moss 2007. I created a drop down column in which has 3 options. If option1 and option 2 are selected the Dropdowns and People pickers should be disabled and if option 3 selected the Dropdowns and People picker columns should be enabled. I provided the page source code, could someone help me out with this with some coding since i am newbie to jquery.</p>
  
  <pre><code>&lt;TR&gt;
              &lt;TD nowrap="true" valign="top" width="190px" class="ms-formlabel"&gt;&lt;H3 class="ms-standardheader"&gt;
              &lt;nobr&gt;Type of Notification&lt;/nobr&gt;
          &lt;/H3&gt;&lt;/TD&gt;
              &lt;TD valign="top" class="ms-formbody" width="400px"&gt;
              &lt;!-- FieldName="Type of Notification"
                   FieldInternalName="Type_x0020_of_x0020_Notification"
                   FieldType="SPFieldChoice"
                --&gt;
                  &lt;span dir="none"&gt;&lt;select name="ctl00$m$g_785c653c_cfa1_4aa5_8060_a84901274cc3$ctl00$ctl04$ctl07$ctl00$ctl00$ctl04$ctl00$DropDownChoice" id="ctl00_m_g_785c653c_cfa1_4aa5_8060_a84901274cc3_ctl00_ctl04_ctl07_ctl00_ctl00_ctl04_ctl00_DropDownChoice" title="Type of Notification" class="ms-RadioText"&gt;
          &lt;option selected="selected" value="Select One"&gt;Select One&lt;/option&gt;
  
          &lt;option value="Option1"&gt;Option1&lt;/option&gt;
          &lt;option value="Option2"&gt;Option2&lt;/option&gt;
                    &lt;option value="Option3"&gt;Option3&lt;/option&gt;
  
      &lt;/select&gt;&lt;br&gt;&lt;/span&gt;&lt;/TD&gt;&lt;/TR&gt;
  &lt;TR&gt;
          &lt;TD nowrap="true" valign="top" width="190px" class="ms-formlabel"&gt;&lt;H3 class="ms-standardheader"&gt;
          &lt;nobr&gt;Functional Team&lt;/nobr&gt;
      &lt;/H3&gt;&lt;/TD&gt;
          &lt;TD valign="top" class="ms-formbody" width="400px"&gt;
          &lt;!-- FieldName="Functional Team"
               FieldInternalName="Mytest"
               FieldType="SPFieldCascadingDropDownListFieldWithFilter"
            --&gt;
              &lt;span dir="none"&gt;
          &lt;select name="ctl00$m$g_785c653c_cfa1_4aa5_8060_a84901274cc3$ctl00$ctl04$ctl16$ctl00$ctl00$ctl04$ctl00$ctl00$Functional Team" onchange="javascript:setTimeout('WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(&amp;quot;ctl00$m$g_785c653c_cfa1_4aa5_8060_a84901274cc3$ctl00$ctl04$ctl16$ctl00$ctl00$ctl04$ctl00$ctl00$Functional Team&amp;quot;, &amp;quot;&amp;quot;, true, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, false, true))', 0)" id="ctl00_m_g_785c653c_cfa1_4aa5_8060_a84901274cc3_ctl00_ctl04_ctl16_ctl00_ctl00_ctl04_ctl00_ctl00_Functional Team" title="Functional Team Parent" class="ms-input"&gt;
      &lt;option selected="selected" value=""&gt;Please select an Item&lt;/option&gt;
      &lt;option value="Test"&gt;Test&lt;/option&gt;
      &lt;option value="Other"&gt;Other&lt;/option&gt; 
  &lt;/select&gt;&lt;/span&gt;&lt;/TD&gt;&lt;/TR&gt;
  &lt;TR&gt;
          &lt;TD nowrap="true" valign="top" width="190px" class="ms-formlabel"&gt;&lt;H3 class="ms-standardheader"&gt;
          &lt;nobr&gt;Therapeutic Area&lt;/nobr&gt;
      &lt;/H3&gt;&lt;/TD&gt;
          &lt;TD valign="top" class="ms-formbody" width="400px"&gt;
          &lt;!-- FieldName="Therapeutic Area"
               FieldInternalName="Therapeutic_x0020_Area"
               FieldType="SPFieldChoice"
            --&gt;
              &lt;span dir="none"&gt;&lt;select name="ctl00$m$g_785c653c_cfa1_4aa5_8060_a84901274cc3$ctl00$ctl04$ctl17$ctl00$ctl00$ctl04$ctl00$DropDownChoice" id="ctl00_m_g_785c653c_cfa1_4aa5_8060_a84901274cc3_ctl00_ctl04_ctl17_ctl00_ctl00_ctl04_ctl00_DropDownChoice" title="Therapeutic Area" class="ms-RadioText"&gt;
      &lt;option selected="selected" value="Select One"&gt;Select One&lt;/option&gt;
      &lt;option value="Anti-Infective"&gt;Anti-Infective&lt;/option&gt;
      &lt;option value="Other"&gt;Other&lt;/option&gt; 
  &lt;/select&gt;&lt;br&gt;&lt;/span&gt;&lt;/TD&gt;   &lt;/TR&gt;
  
  &lt;TR&gt;
          &lt;TD nowrap="true" valign="top" width="190px" class="ms-formlabel"&gt;&lt;H3 class="ms-standardheader"&gt;
          &lt;nobr&gt;Admin Name&lt;/nobr&gt;
      &lt;/H3&gt;&lt;/TD&gt;
          &lt;TD valign="top" class="ms-formbody" width="400px"&gt;
          &lt;!-- FieldName="Admin Name"
               FieldInternalName="Admin_x0020_Name"
               FieldType="SPFieldUser"
            --&gt;
              &lt;span dir="none"&gt;
          &lt;input name="ctl00$m$g_785c653c_cfa1_4aa5_8060_a84901274cc3$ctl00$ctl04$ctl20$ctl00$ctl00$ctl04$ctl00$ctl00$HiddenUserFieldValue" type="hidden" id="ctl00_m_g_785c653c_cfa1_4aa5_8060_a84901274cc3_ctl00_ctl04_ctl20_ctl00_ctl00_ctl04_ctl00_ctl00_HiddenUserFieldValue" /&gt;
          &lt;span id="ctl00_m_g_785c653c_cfa1_4aa5_8060_a84901274cc3_ctl00_ctl04_ctl20_ctl00_ctl00_ctl04_ctl00_ctl00_UserField" class="ms-usereditor" NoMatchesText="&amp;lt;No Matching Names&gt;" MoreItemsText="More Names..." RemoveText="Remove" value="" allowEmpty="1" ShowEntityDisplayTextInTextBox="0" EEAfterCallbackClientScript=""&gt;&lt;input name="ctl00$m$g_785c653c_cfa1_4aa5_8060_a84901274cc3$ctl00$ctl04$ctl20$ctl00$ctl00$ctl04$ctl00$ctl00$UserField$hiddenSpanData" type="hidden" id="ctl00_m_g_785c653c_cfa1_4aa5_8060_a84901274cc3_ctl00_ctl04_ctl20_ctl00_ctl00_ctl04_ctl00_ctl00_UserField_hiddenSpanData" /&gt;&lt;input name="ctl00$m$g_785c653c_cfa1_4aa5_8060_a84901274cc3$ctl00$ctl04$ctl20$ctl00$ctl00$ctl04$ctl00$ctl00$UserField$OriginalEntities" type="hidden" id="ctl00_m_g_785c653c_cfa1_4aa5_8060_a84901274cc3_ctl00_ctl04_ctl20_ctl00_ctl00_ctl04_ctl00_ctl00_UserField_OriginalEntities" value="&amp;lt;Entities /&gt;" /&gt;&lt;input name="ctl00$m$g_785c653c_cfa1_4aa5_8060_a84901274cc3$ctl00$ctl04$ctl20$ctl00$ctl00$ctl04$ctl00$ctl00$UserField$HiddenEntityKey" type="hidden" id="ctl00_m_g_785c653c_cfa1_4aa5_8060_a84901274cc3_ctl00_ctl04_ctl20_ctl00_ctl00_ctl04_ctl00_ctl00_UserField_HiddenEntityKey" /&gt;&lt;input name="ctl00$m$g_785c653c_cfa1_4aa5_8060_a84901274cc3$ctl00$ctl04$ctl20$ctl00$ctl00$ctl04$ctl00$ctl00$UserField$HiddenEntityDisplayText" type="hidden" id="ctl00_m_g_785c653c_cfa1_4aa5_8060_a84901274cc3_ctl00_ctl04_ctl20_ctl00_ctl00_ctl04_ctl00_ctl00_UserField_HiddenEntityDisplayText" /&gt;&lt;table id="ctl00_m_g_785c653c_cfa1_4aa5_8060_a84901274cc3_ctl00_ctl04_ctl20_ctl00_ctl00_ctl04_ctl00_ctl00_UserField_OuterTable" class="ms-usereditor" cellspacing="0" cellpadding="0" border="0" style="border-collapse:collapse;"&gt;
      &lt;tr valign="bottom"&gt;
          &lt;td valign="top" style="width:90%;"&gt;&lt;table cellpadding="0" cellspacing="0" border="0" style="width:100%;table-layout:fixed;"&gt;
              &lt;tr&gt;
                  &lt;td&gt;&lt;div id="ctl00_m_g_785c653c_cfa1_4aa5_8060_a84901274cc3_ctl00_ctl04_ctl20_ctl00_ctl00_ctl04_ctl00_ctl00_UserField_upLevelDiv" TabIndex="0" onFocusIn="this._fFocus=1;saveOldEntities('ctl00_m_g_785c653c_cfa1_4aa5_8060_a84901274cc3_ctl00_ctl04_ctl20_ctl00_ctl00_ctl04_ctl00_ctl00_UserField_upLevelDiv')" onClick="onClickRw(true, true);" onChange="updateControlValue('ctl00_m_g_785c653c_cfa1_4aa5_8060_a84901274cc3_ctl00_ctl04_ctl20_ctl00_ctl00_ctl04_ctl00_ctl00_UserField')" onFocusOut="this._fFocus=0;" onPaste="dopaste();" AutoPostBack="0" class="ms-inputuserfield" onDragStart="canEvt(event);" onKeyup="return onKeyUpRw('ctl00_m_g_785c653c_cfa1_4aa5_8060_a84901274cc3_ctl00_ctl04_ctl20_ctl00_ctl00_ctl04_ctl00_ctl00_UserField');" onCopy="docopy();" onBlur="updateControlValue('ctl00_m_g_785c653c_cfa1_4aa5_8060_a84901274cc3_ctl00_ctl04_ctl20_ctl00_ctl00_ctl04_ctl00_ctl00_UserField')" Title="People Picker" onKeyDown="return onKeyDownRw(this, 'ctl00_m_g_785c653c_cfa1_4aa5_8060_a84901274cc3_ctl00_ctl04_ctl20_ctl00_ctl00_ctl04_ctl00_ctl00_UserField', 3, true, event);" contentEditable="true" style="width: 100%; word-wrap: break-work;overflow-x: hidden; background-color: window; color: windowtext;" name="upLevelDiv"&gt;&lt;/div&gt;&lt;textarea name="ctl00$m$g_785c653c_cfa1_4aa5_8060_a84901274cc3$ctl00$ctl04$ctl20$ctl00$ctl00$ctl04$ctl00$ctl00$UserField$downlevelTextBox" rows="1" cols="20" id="ctl00_m_g_785c653c_cfa1_4aa5_8060_a84901274cc3_ctl00_ctl04_ctl20_ctl00_ctl00_ctl04_ctl00_ctl00_UserField_downlevelTextBox" class="ms-input" onKeyDown="return onKeyDownRw(this, 'ctl00_m_g_785c653c_cfa1_4aa5_8060_a84901274cc3_ctl00_ctl04_ctl20_ctl00_ctl00_ctl04_ctl00_ctl00_UserField', 3, true, event);" onKeyUp="onKeyUpRw('ctl00_m_g_785c653c_cfa1_4aa5_8060_a84901274cc3_ctl00_ctl04_ctl20_ctl00_ctl00_ctl04_ctl00_ctl00_UserField');" Title="People Picker" AutoPostBack="0" style="width:100%;display: none;position: absolute; "&gt;&lt;/textarea&gt;&lt;/td&gt;
              &lt;/tr&gt;
          &lt;/table&gt;&lt;/td&gt;&lt;td align="right" valign="top" nowrap="true" style="padding-left:5px;"&gt;&lt;a id="ctl00_m_g_785c653c_cfa1_4aa5_8060_a84901274cc3_ctl00_ctl04_ctl20_ctl00_ctl00_ctl04_ctl00_ctl00_UserField_checkNames" title="Check Names" onclick="var arg=getUplevel('ctl00_m_g_785c653c_cfa1_4aa5_8060_a84901274cc3_ctl00_ctl04_ctl20_ctl00_ctl00_ctl04_ctl00_ctl00_UserField');var ctx='ctl00_m_g_785c653c_cfa1_4aa5_8060_a84901274cc3_ctl00_ctl04_ctl20_ctl00_ctl00_ctl04_ctl00_ctl00_UserField';EntityEditorSetWaitCursor(ctx);WebForm_DoCallback('ctl00$m$g_785c653c_cfa1_4aa5_8060_a84901274cc3$ctl00$ctl04$ctl20$ctl00$ctl00$ctl04$ctl00$ctl00$UserField',arg,EntityEditorHandleCheckNameResult,ctx,EntityEditorHandleCheckNameError,true);return false;" href="javascript:"&gt;&lt;img title="Check Names" src="/_layouts/images/checknames.gif" alt="Check Names" style="border-width:0px;" /&gt;&lt;/a&gt;&amp;nbsp;&lt;a id="ctl00_m_g_785c653c_cfa1_4aa5_8060_a84901274cc3_ctl00_ctl04_ctl20_ctl00_ctl00_ctl04_ctl00_ctl00_UserField_browse" accesskey="B" title="Browse" onclick="__Dialog__ctl00_m_g_785c653c_cfa1_4aa5_8060_a84901274cc3_ctl00_ctl04_ctl20_ctl00_ctl00_ctl04_ctl00_ctl00_UserField(); return false;" href="javascript:"&gt;&lt;img title="Browse" src="/_layouts/images/addressbook.gif" alt="Browse" style="border-width:0px;" /&gt;&lt;/a&gt;&lt;/td&gt;
      &lt;/tr&gt;&lt;tr&gt;
          &lt;td colspan="3"&gt;&lt;span id="ctl00_m_g_785c653c_cfa1_4aa5_8060_a84901274cc3_ctl00_ctl04_ctl20_ctl00_ctl00_ctl04_ctl00_ctl00_UserField_errorLabel" class="ms-error"&gt;&lt;/span&gt;&lt;/td&gt;
      &lt;/tr&gt;
  &lt;/table&gt;&lt;/span&gt;
      &lt;/span&gt;
  
  
          &lt;/TD&gt;
      &lt;/TR&gt;
  </code></pre>