Expand section On Click

I have copied the NewForm.aspx of a custom list (called NewUserRequests) and renamed it to NewRequestForm.aspx.
I have inserted table inside of a row which resides underneath a row called 'CM Network Access'.
I would like to hide this embedded table unless the field above is checked 'Yes'.

I have attached the section that includes the row with the Checkbox item ('CM Network Access') and the table following that needs to be hidden until CM Network Access = 'Yes'.


<tr>
  <td width="190px" valign="top" class="ms-formlabel">
       <H3 class="ms-standardheader">					                          <nobr>CM Network Access</nobr>							                 </H3>
   </td>
   <td width="400px" valign="top" class="ms-formbody">							<SharePoint:FormField runat="server" id="ff9{$Pos}" ControlMode="New" FieldName="CM_x0020_Network_x0020_Access" __designer:bind="{ddwrt:DataBind('i',concat('ff9',$Pos),'Value','ValueChanged','ID',ddwrt:EscapeDelims(string(@ID)),'@CM_x0020_Network_x0020_Access')}"/>
							<SharePoint:FieldDescription runat="server" id="ff9description{$Pos}" FieldName="CM_x0020_Network_x0020_Access" ControlMode="New"/>
	</td>
   </tr>						
   <tr>
	<td width="190px" valign="top" class="ms-formlabel" />
<td width="400px" valign="top" class="ms-formbody">
	<table style="width: 100%">
		<tr>
			<td width="190px" valign="top" class="ms-formlabel">	
<H3 class="ms-standardheader">
<nobr>Hardware</nobr>
</H3>
	</td>										
	<td width="400px" valign="top" class="ms-formbody">
<SharePoint:FormField runat="server" id="ff14{$Pos}" ControlMode="New" FieldName="Hardware" __designer:bind="{ddwrt:DataBind('i',concat('ff14',$Pos),'Value','ValueChanged','ID',ddwrt:EscapeDelims(string(@ID)),'@Hardware')}" />
										<SharePoint:FieldDescription runat="server" id="ff14description{$Pos}" FieldName="Hardware" ControlMode="New" />										</td>
</tr>										<tr>										<td width="190px" valign="top" class="ms-formlabel">										<H3 class="ms-standardheader">										<nobr>Software</nobr>
</H3>
</td>
<td width="400px" valign="top" class="ms-formbody">
<SharePoint:FormField runat="server" id="ff15{$Pos}" ControlMode="New" FieldName="Software" __designer:bind="{ddwrt:DataBind('i',concat('ff15',$Pos),'Value','ValueChanged','ID',ddwrt:EscapeDelims(string(@ID)),'@Software')}" />
<SharePoint:FieldDescription runat="server" id="ff15description{$Pos}" FieldName="Software" ControlMode="New" />
</td>
</tr>
<tr>
<td width="190px" valign="top" class="ms-formlabel">
<H3 class="ms-standardheader">
<nobr>Mapped Drive</nobr>
</H3>
</td>
<td width="400px" valign="top" class="ms-formbody">
<SharePoint:FormField runat="server" id="ff16{$Pos}" ControlMode="New" FieldName="Mapped_x0020_Drive" __designer:bind="{ddwrt:DataBind('i',concat('ff16',$Pos),'Value','ValueChanged','ID',ddwrt:EscapeDelims(string(@ID)),'@Mapped_x0020_Drive')}" /><SharePoint:FieldDescription runat="server" id="ff16description{$Pos}" FieldName="Mapped_x0020_Drive" ControlMode="New" /></td></tr><tr><td width="190px" valign="top" class="ms-formlabel"><H3 class="ms-standardheader"><nobr>Email Address</nobr></H3></td><td width="400px" valign="top" class="ms-formbody"><SharePoint:FormField runat="server" id="ff5{$Pos}" ControlMode="New" FieldName="Email_x0020_Required_x003f_" __designer:bind="{ddwrt:DataBind('i',concat('ff5',$Pos),'Value','ValueChanged','ID',ddwrt:EscapeDelims(string(@ID)),'@Email_x0020_Required_x003f_')}" /><SharePoint:FieldDescription runat="server" id="ff5description{$Pos}" FieldName="Email_x0020_Required_x003f_" ControlMode="New" /></td></tr><tr><td width="190px" valign="top" class="ms-formlabel"><H3 class="ms-standardheader"><nobr>Color Printer Access</nobr></H3></td><td width="400px" valign="top" class="ms-formbody"><SharePoint:FormField runat="server" id="ff6{$Pos}" ControlMode="New" FieldName="Color_x0020_Printer_x0020_Access" __designer:bind="{ddwrt:DataBind('i',concat('ff6',$Pos),'Value','ValueChanged','ID',ddwrt:EscapeDelims(string(@ID)),'@Color_x0020_Printer_x0020_Access')}" /><SharePoint:FieldDescription runat="server" id="ff6description{$Pos}" FieldName="Color_x0020_Printer_x0020_Access" ControlMode="New" /></td>
										</tr></table>
										</td></tr>

Open in new window

CrossmatchAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
CrossmatchAuthor Commented:
That gets me half way there. Thank you so much!

But I need to start with the fields as hidden, and then the click function will come in to play to display it.
Also, is it possible to toggle the whole table instead of having to enter each title of each field in to the script?

I tried the following (attached code), but the table did not hide. I am very new with javascript so any help is greatly appreciated.

Thanks!
<!--START2-->
 <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script>

<script>
$(document).ready(function()
{
$($'CMTable').hide();
$("input[title$='CM Network Access']").click(function()
{
$("input[title$='Title']").parent('span').parent('td').parent('tr').toggle();
$("nobr:contains('Start Date')").parent('h3').parent('td').parent('tr').toggle();
//$("nobr:contains('Due Date')").parent('h3').parent('td').parent('tr').toggle();
});
});
</script>
 <!--END2-->

Open in new window

0
CrossmatchAuthor Commented:
Was able to figure it out. Attached is the code used.

Thank you bhagavan2uday
	<!--START2-->
 <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script>
<script>
$(document).ready(function()
{
$("#HideThis1").hide();
$("input[title$='CM Network Access']").click(function()
{
$("#HideThis1").toggle();
});
});
</script>
 <!--END2-->

Open in new window

0
CrossmatchAuthor Commented:
Provided the basis of what I needed. Needed to manipulate it some to hide the table first and to hide the whole section rather than the individual fields.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SharePoint

From novice to tech pro — start learning today.