Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 865
  • Last Modified:

Field in form based on another

I am using SharePoint 2010.

I created a list in SharePoint 2010 with a few columns.  Two of my columns are "status" and "Completion Date".  The status column is a choice column with the following values "Complete", "In Progress" and "Not Started".

What I want to happen is if the user picks "Complete" from the "Status" field, the "Completion Date" should then become required.

Is this possible in SharePoint Designer 2010? or is this something that can be done with jQuery?  If so, how?

Thanks!
0
Isaac
Asked:
Isaac
  • 3
  • 2
1 Solution
 
MrunalCommented:
hi,
I have not any idea what the code you have.
If you share your code then we can provide you jQuery vlaidation code for your requirement.

Also check out below link. This may you need and want to implement...

http://jsfiddle.net/dUN5H/
0
 
Rainer JeschorCommented:
Hi,
there are multiple options e.g. adjusting the new- and edit forms with InfoPath.

The other solution  should be a two part tasks:

The first one is the list item validation. Therefore go to the list settings, Validation Settings and enter this formula
=IF(Status="Complete",IF([Completion Date]<>"",TRUE,FALSE),TRUE)

Open in new window

and an appropriate user message.

Now if you want to mark the field as required you would have to use some kind of jQuery to show the "required symbol *".
I will update the question with the jQuery solution later.

HTH
Rainer
0
 
Rainer JeschorCommented:
Hi,
and here from an old question the jQuery part:
http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/Server/MS-SharePoint/Q_27796470.html

To help you directly with the correct jQuery selectors, please attach the generated HTML code of your form.

HTH
Rainer
0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

 
IsaacSharePoint Client Side DeveloperAuthor Commented:
Sorry for the late response.

Here's the code....

<table class="ms-formtable" style="margin-top: 8px;" border="0" cellpadding="0" cellspacing="0" width="100%">
			
			
			
		<tr>
		<td nowrap="true" valign="top" width="190px" class="ms-formlabel"><h3 class="ms-standardheader">
		<nobr>Deliverable Name</nobr>
	</h3></td>
		<td valign="top" class="ms-formbody">
		<!-- FieldName="Deliverable Name"
			 FieldInternalName="Title"
			 FieldType="SPFieldText"
		  -->
			<span dir="none">
		<input name="ctl00$m$g_7e20110a_595a_4c83_ad05_2423c63ac4d6$ctl00$ctl05$ctl00$ctl00$ctl00$ctl04$ctl00$ctl00$TextField" type="text" maxlength="255" id="ctl00_m_g_7e20110a_595a_4c83_ad05_2423c63ac4d6_ctl00_ctl05_ctl00_ctl00_ctl00_ctl04_ctl00_ctl00_TextField" title="Deliverable Name" class="ms-long ms-spellcheck-true" /><br />
	</span>
			
			
		</td>
	</tr>
	
		<tr>
		<td nowrap="true" valign="top" width="190px" class="ms-formlabel"><h3 class="ms-standardheader">
		<nobr>FY</nobr>
	</h3></td>
		<td valign="top" class="ms-formbody">
		<!-- FieldName="FY"
			 FieldInternalName="FY"
			 FieldType="SPFieldLookup"
		  -->
			<span dir="none"><select name="ctl00$m$g_7e20110a_595a_4c83_ad05_2423c63ac4d6$ctl00$ctl05$ctl01$ctl00$ctl00$ctl04$ctl00$Lookup" id="ctl00_m_g_7e20110a_595a_4c83_ad05_2423c63ac4d6_ctl00_ctl05_ctl01_ctl00_ctl00_ctl04_ctl00_Lookup" title="FY">
					<option selected="selected" value="0">(None)</option>
					<option value="1">2012</option>
					<option value="2">2013</option>
					<option value="3">2014</option>
 
				</select><br/></span>
			
			
		</td>
	</tr>
	
		<tr>
		<td nowrap="true" valign="top" width="190px" class="ms-formlabel"><h3 class="ms-standardheader">
		<nobr>Activity</nobr>
	</h3></td>
		<td valign="top" class="ms-formbody">
		<!-- FieldName="Activity"
			 FieldInternalName="Activity"
			 FieldType="SPFieldLookup"
		  -->
			<span dir="none"><select name="ctl00$m$g_7e20110a_595a_4c83_ad05_2423c63ac4d6$ctl00$ctl05$ctl02$ctl00$ctl00$ctl04$ctl00$Lookup" id="ctl00_m_g_7e20110a_595a_4c83_ad05_2423c63ac4d6_ctl00_ctl05_ctl02_ctl00_ctl00_ctl04_ctl00_Lookup" title="Activity">
					<option selected="selected" value="0">(None)</option>
					<option value="1">Aerial Networking</option>
					<option value="2">AISR Comms</option>
					<option value="3">Cross-Cutting</option>
					<option value="4">Maritime Networking</option>
					<option value="5">OTHER</option>
					<option value="6">Roadmaps</option>
					<option value="7">SATCOM &amp; Terminals</option>
					<option value="8">Tactical Networking</option>
 
				</select><br/></span>
			
			
		</td>
	</tr>
	
		<tr>
		<td nowrap="true" valign="top" width="190px" class="ms-formlabel"><h3 class="ms-standardheader">
		<nobr>Function</nobr>
	</h3></td>
		<td valign="top" class="ms-formbody">
		<!-- FieldName="Function"
			 FieldInternalName="Function"
			 FieldType="SPFieldLookup"
		  -->
			<span dir="none"><select name="ctl00$m$g_7e20110a_595a_4c83_ad05_2423c63ac4d6$ctl00$ctl05$ctl03$ctl00$ctl00$ctl04$ctl00$Lookup" id="ctl00_m_g_7e20110a_595a_4c83_ad05_2423c63ac4d6_ctl00_ctl05_ctl03_ctl00_ctl00_ctl04_ctl00_Lookup" title="Function">
					<option selected="selected" value="0">(None)</option>
					<option value="1">AoAs</option>
					<option value="2">Assessments</option>
					<option value="3">Long-Range Plans &amp; Resource Allocation</option>
					<option value="7">OTHER</option>
					<option value="4">Portfolio Mgt &amp; Systems Eng.</option>
					<option value="5">Program Oversight</option>
					<option value="6">Technical Oversiht</option>
 
				</select><br/></span>
			
			
		</td>
	</tr>
	
		<tr>
		<td nowrap="true" valign="top" width="190px" class="ms-formlabel"><h3 class="ms-standardheader">
		<nobr>Project</nobr>
	</h3></td>
		<td valign="top" class="ms-formbody">
		<!-- FieldName="Project"
			 FieldInternalName="Project"
			 FieldType="SPFieldText"
		  -->
			<span dir="none">
		<input name="ctl00$m$g_7e20110a_595a_4c83_ad05_2423c63ac4d6$ctl00$ctl05$ctl04$ctl00$ctl00$ctl04$ctl00$ctl00$TextField" type="text" maxlength="255" id="ctl00_m_g_7e20110a_595a_4c83_ad05_2423c63ac4d6_ctl00_ctl05_ctl04_ctl00_ctl00_ctl04_ctl00_ctl00_TextField" title="Project" class="ms-long ms-spellcheck-true" /><br />
	</span>
			
			
		</td>
	</tr>
	
		<tr>
		<td nowrap="true" valign="top" width="190px" class="ms-formlabel"><h3 class="ms-standardheader">
		<nobr>Govt Lead</nobr>
	</h3></td>
		<td valign="top" class="ms-formbody">
		<!-- FieldName="Govt Lead"
			 FieldInternalName="GovtLead"
			 FieldType="SPFieldLookup"
		  -->
			<span dir="none"><select name="ctl00$m$g_7e20110a_595a_4c83_ad05_2423c63ac4d6$ctl00$ctl05$ctl05$ctl00$ctl00$ctl04$ctl00$Lookup" id="ctl00_m_g_7e20110a_595a_4c83_ad05_2423c63ac4d6_ctl00_ctl05_ctl05_ctl00_ctl00_ctl04_ctl00_Lookup" title="Govt Lead">
					<option selected="selected" value="0">(None)</option>
					<option value="6">Brown</option>
					<option value="7">Cardwell</option>
					<option value="4">Chartier</option>
					<option value="8">Corbett</option>
					<option value="2">Greenfield</option>
					<option value="3">Myers</option>
					<option value="1">Pino</option>
					<option value="5">Yarbrough</option>
 
				</select><br/></span>
			
			
		</td>
	</tr>
	
		<tr>
		<td nowrap="true" valign="top" width="190px" class="ms-formlabel"><h3 class="ms-standardheader">
		<nobr>Product</nobr>
	</h3></td>
		<td valign="top" class="ms-formbody">
		<!-- FieldName="Product"
			 FieldInternalName="Product"
			 FieldType="SPFieldText"
		  -->
			<span dir="none">
		<input name="ctl00$m$g_7e20110a_595a_4c83_ad05_2423c63ac4d6$ctl00$ctl05$ctl06$ctl00$ctl00$ctl04$ctl00$ctl00$TextField" type="text" maxlength="255" id="ctl00_m_g_7e20110a_595a_4c83_ad05_2423c63ac4d6_ctl00_ctl05_ctl06_ctl00_ctl00_ctl04_ctl00_ctl00_TextField" title="Product" class="ms-long ms-spellcheck-true" /><br />
	</span>
			
			
		</td>
	</tr>
	
		<tr>
		<td nowrap="true" valign="top" width="190px" class="ms-formlabel"><h3 class="ms-standardheader">
		<nobr>Performer</nobr>
	</h3></td>
		<td valign="top" class="ms-formbody">
		<!-- FieldName="Performer"
			 FieldInternalName="Performer"
			 FieldType="SPFieldLookup"
		  -->
			<span dir="none"><select name="ctl00$m$g_7e20110a_595a_4c83_ad05_2423c63ac4d6$ctl00$ctl05$ctl07$ctl00$ctl00$ctl04$ctl00$Lookup" id="ctl00_m_g_7e20110a_595a_4c83_ad05_2423c63ac4d6_ctl00_ctl05_ctl07_ctl00_ctl00_ctl04_ctl00_Lookup" title="Performer">
					<option selected="selected" value="0">(None)</option>
 
				</select><br/></span>
			
			
		</td>
	</tr>
	
		<tr>
		<td nowrap="true" valign="top" width="190px" class="ms-formlabel"><h3 class="ms-standardheader">
		<nobr>Performer POCs</nobr>
	</h3></td>
		<td valign="top" class="ms-formbody">
		<!-- FieldName="Performer POCs"
			 FieldInternalName="PerformerPOCs"
			 FieldType="SPFieldLookupMulti"
		  -->
			<span dir="none">
		<input id="ctl00_m_g_7e20110a_595a_4c83_ad05_2423c63ac4d6_ctl00_ctl05_ctl08_ctl00_ctl00_ctl04_ctl00_ctl00_MultiLookupPicker" name="ctl00$m$g_7e20110a_595a_4c83_ad05_2423c63ac4d6$ctl00$ctl05$ctl08$ctl00$ctl00$ctl04$ctl00$ctl00$MultiLookupPicker" type="hidden"></input><input id="ctl00_m_g_7e20110a_595a_4c83_ad05_2423c63ac4d6_ctl00_ctl05_ctl08_ctl00_ctl00_ctl04_ctl00_ctl00_MultiLookupPicker_data" name="ctl00$m$g_7e20110a_595a_4c83_ad05_2423c63ac4d6$ctl00$ctl05$ctl08$ctl00$ctl00$ctl04$ctl00$ctl00$MultiLookupPicker$data" type="hidden" value=""></input><input id="ctl00_m_g_7e20110a_595a_4c83_ad05_2423c63ac4d6_ctl00_ctl05_ctl08_ctl00_ctl00_ctl04_ctl00_ctl00_MultiLookupPicker_initial" name="ctl00$m$g_7e20110a_595a_4c83_ad05_2423c63ac4d6$ctl00$ctl05$ctl08$ctl00$ctl00$ctl04$ctl00$ctl00$MultiLookupPicker$initial" type="hidden" value=""></input>
		<table class="ms-long" cellpadding="0" cellspacing="0" border="0">
			<tr>
				<td class="ms-input">
					<select name="ctl00$m$g_7e20110a_595a_4c83_ad05_2423c63ac4d6$ctl00$ctl05$ctl08$ctl00$ctl00$ctl04$ctl00$ctl00$SelectCandidate" id="ctl00_m_g_7e20110a_595a_4c83_ad05_2423c63ac4d6_ctl00_ctl05_ctl08_ctl00_ctl00_ctl04_ctl00_ctl00_SelectCandidate" multiple="multiple" title="Performer POCs possible values" onchange="GipSelectCandidateItems(ctl00_m_g_7e20110a_595a_4c83_ad05_2423c63ac4d6_ctl00_ctl05_ctl08_ctl00_ctl00_ctl04_ctl00_ctl00_MultiLookupPicker_m);" ondblclick="GipAddSelectedItems(ctl00_m_g_7e20110a_595a_4c83_ad05_2423c63ac4d6_ctl00_ctl05_ctl08_ctl00_ctl00_ctl04_ctl00_ctl00_MultiLookupPicker_m); return false" style="width:143px;height:125px;overflow:scroll;">
				</select>
				</td>
				<td style="padding-left:10px">
				<td align="center" valign="middle" class="ms-input"><button id="ctl00_m_g_7e20110a_595a_4c83_ad05_2423c63ac4d6_ctl00_ctl05_ctl08_ctl00_ctl00_ctl04_ctl00_ctl00_AddButton" class="ms-ButtonHeightWidth" onclick="GipAddSelectedItems(ctl00_m_g_7e20110a_595a_4c83_ad05_2423c63ac4d6_ctl00_ctl05_ctl08_ctl00_ctl00_ctl04_ctl00_ctl00_MultiLookupPicker_m); return false"> Add &gt; </button><br />
					<br /><button id="ctl00_m_g_7e20110a_595a_4c83_ad05_2423c63ac4d6_ctl00_ctl05_ctl08_ctl00_ctl00_ctl04_ctl00_ctl00_RemoveButton" class="ms-ButtonHeightWidth" onclick="GipRemoveSelectedItems(ctl00_m_g_7e20110a_595a_4c83_ad05_2423c63ac4d6_ctl00_ctl05_ctl08_ctl00_ctl00_ctl04_ctl00_ctl00_MultiLookupPicker_m); return false"> &lt; Remove </button>
				</td>
				<td style="padding-left:10px">
				<td class="ms-input">
					<select name="ctl00$m$g_7e20110a_595a_4c83_ad05_2423c63ac4d6$ctl00$ctl05$ctl08$ctl00$ctl00$ctl04$ctl00$ctl00$SelectResult" id="ctl00_m_g_7e20110a_595a_4c83_ad05_2423c63ac4d6_ctl00_ctl05_ctl08_ctl00_ctl00_ctl04_ctl00_ctl00_SelectResult" multiple="multiple" title="Performer POCs selected values" onchange="GipSelectResultItems(ctl00_m_g_7e20110a_595a_4c83_ad05_2423c63ac4d6_ctl00_ctl05_ctl08_ctl00_ctl00_ctl04_ctl00_ctl00_MultiLookupPicker_m);" ondblclick="GipRemoveSelectedItems(ctl00_m_g_7e20110a_595a_4c83_ad05_2423c63ac4d6_ctl00_ctl05_ctl08_ctl00_ctl00_ctl04_ctl00_ctl00_MultiLookupPicker_m); return false" style="width:143px;height:125px;overflow:scroll;">
				</select>
				</td>
			</tr>
		</table>
	</span>
			
			
		</td>
	</tr>
	
		<tr>
		<td nowrap="true" valign="top" width="190px" class="ms-formlabel"><h3 class="ms-standardheader">
		<nobr>Description</nobr>
	</h3></td>
		<td valign="top" class="ms-formbody">
		<!-- FieldName="Description"
			 FieldInternalName="Description"
			 FieldType="SPFieldNote"
		  -->
			<span dir="none">
		<textarea name="ctl00$m$g_7e20110a_595a_4c83_ad05_2423c63ac4d6$ctl00$ctl05$ctl09$ctl00$ctl00$ctl04$ctl00$ctl00$TextField" rows="6" cols="20" id="ctl00_m_g_7e20110a_595a_4c83_ad05_2423c63ac4d6_ctl00_ctl05_ctl09_ctl00_ctl00_ctl04_ctl00_ctl00_TextField" title="Description" class="ms-long" dir="none"></textarea><br />
	</span>
			
			
		</td>
	</tr>
	
		<tr>
		<td nowrap="true" valign="top" width="190px" class="ms-formlabel"><h3 class="ms-standardheader">
		<nobr>StartDate</nobr>
	</h3></td>
		<td valign="top" class="ms-formbody">
		<!-- FieldName="StartDate"
			 FieldInternalName="StartDate"
			 FieldType="SPFieldDateTime"
		  -->
			<span dir="none">
		<script type="text/javascript">g_strDateTimeControlIDs["SPStartDate"] = "ctl00_m_g_7e20110a_595a_4c83_ad05_2423c63ac4d6_ctl00_ctl05_ctl10_ctl00_ctl00_ctl04_ctl00_ctl00_DateTimeField_DateTimeFieldDate";</script>
				<table border="0" cellpadding="0" cellspacing="0"><tr>
				<td class="ms-dtinput" >
				<label for="ctl00_m_g_7e20110a_595a_4c83_ad05_2423c63ac4d6_ctl00_ctl05_ctl10_ctl00_ctl00_ctl04_ctl00_ctl00_DateTimeField_DateTimeFieldDate" style="display:none">StartDate Date</label>
				<input name="ctl00$m$g_7e20110a_595a_4c83_ad05_2423c63ac4d6$ctl00$ctl05$ctl10$ctl00$ctl00$ctl04$ctl00$ctl00$DateTimeField$DateTimeFieldDate" type="text" maxlength="45" id="ctl00_m_g_7e20110a_595a_4c83_ad05_2423c63ac4d6_ctl00_ctl05_ctl10_ctl00_ctl00_ctl04_ctl00_ctl00_DateTimeField_DateTimeFieldDate" title="StartDate" class="ms-input" AutoPostBack="0" /></td>
				<td class="ms-dtinput" >
				<a href="#" onclick='clickDatePicker("ctl00_m_g_7e20110a_595a_4c83_ad05_2423c63ac4d6_ctl00_ctl05_ctl10_ctl00_ctl00_ctl04_ctl00_ctl00_DateTimeField_DateTimeFieldDate", "\u002fCNportal\u002f_layouts\u002fiframe.aspx?&amp;cal=1&amp;lcid=1033&amp;langid=1033&amp;tz=-08:00:00.0002950&amp;ww=0111110&amp;fdow=0&amp;fwoy=0&amp;hj=0&amp;swn=False&amp;minjday=109207&amp;maxjday=2666269&amp;date=", "", event);return false;' ><img id="ctl00_m_g_7e20110a_595a_4c83_ad05_2423c63ac4d6_ctl00_ctl05_ctl10_ctl00_ctl00_ctl04_ctl00_ctl00_DateTimeField_DateTimeFieldDateDatePickerImage" src="/_layouts/images/calendar.gif" border="0" alt="Select a date from the calendar."></img></a></td>
				<td>
				<iframe id="ctl00_m_g_7e20110a_595a_4c83_ad05_2423c63ac4d6_ctl00_ctl05_ctl10_ctl00_ctl00_ctl04_ctl00_ctl00_DateTimeField_DateTimeFieldDateDatePickerFrame" src="/_layouts/images/blank.gif" frameborder="0" scrolling="no" style="DISPLAY:none;POSITION:absolute; width:200px; Z-INDEX:101;" title="Select a date from the calendar."></iframe></td>
				</tr></table>
				
	</span>
			
			
		</td>
	</tr>
	
		<tr>
		<td nowrap="true" valign="top" width="190px" class="ms-formlabel"><h3 class="ms-standardheader">
		<nobr>EndDate</nobr>
	</h3></td>
		<td valign="top" class="ms-formbody">
		<!-- FieldName="EndDate"
			 FieldInternalName="EndDate"
			 FieldType="SPFieldDateTime"
		  -->
			<span dir="none">
		<script type="text/javascript">g_strDateTimeControlIDs["SPEndDate"] = "ctl00_m_g_7e20110a_595a_4c83_ad05_2423c63ac4d6_ctl00_ctl05_ctl11_ctl00_ctl00_ctl04_ctl00_ctl00_DateTimeField_DateTimeFieldDate";</script>
				<table border="0" cellpadding="0" cellspacing="0"><tr>
				<td class="ms-dtinput" >
				<label for="ctl00_m_g_7e20110a_595a_4c83_ad05_2423c63ac4d6_ctl00_ctl05_ctl11_ctl00_ctl00_ctl04_ctl00_ctl00_DateTimeField_DateTimeFieldDate" style="display:none">EndDate Date</label>
				<input name="ctl00$m$g_7e20110a_595a_4c83_ad05_2423c63ac4d6$ctl00$ctl05$ctl11$ctl00$ctl00$ctl04$ctl00$ctl00$DateTimeField$DateTimeFieldDate" type="text" maxlength="45" id="ctl00_m_g_7e20110a_595a_4c83_ad05_2423c63ac4d6_ctl00_ctl05_ctl11_ctl00_ctl00_ctl04_ctl00_ctl00_DateTimeField_DateTimeFieldDate" title="EndDate" class="ms-input" AutoPostBack="0" /></td>
				<td class="ms-dtinput" >
				<a href="#" onclick='clickDatePicker("ctl00_m_g_7e20110a_595a_4c83_ad05_2423c63ac4d6_ctl00_ctl05_ctl11_ctl00_ctl00_ctl04_ctl00_ctl00_DateTimeField_DateTimeFieldDate", "\u002fCNportal\u002f_layouts\u002fiframe.aspx?&amp;cal=1&amp;lcid=1033&amp;langid=1033&amp;tz=-08:00:00.0002951&amp;ww=0111110&amp;fdow=0&amp;fwoy=0&amp;hj=0&amp;swn=False&amp;minjday=109207&amp;maxjday=2666269&amp;date=", "", event);return false;' ><img id="ctl00_m_g_7e20110a_595a_4c83_ad05_2423c63ac4d6_ctl00_ctl05_ctl11_ctl00_ctl00_ctl04_ctl00_ctl00_DateTimeField_DateTimeFieldDateDatePickerImage" src="/_layouts/images/calendar.gif" border="0" alt="Select a date from the calendar."></img></a></td>
				<td>
				<iframe id="ctl00_m_g_7e20110a_595a_4c83_ad05_2423c63ac4d6_ctl00_ctl05_ctl11_ctl00_ctl00_ctl04_ctl00_ctl00_DateTimeField_DateTimeFieldDateDatePickerFrame" src="/_layouts/images/blank.gif" frameborder="0" scrolling="no" style="DISPLAY:none;POSITION:absolute; width:200px; Z-INDEX:101;" title="Select a date from the calendar."></iframe></td>
				</tr></table>
				
	</span>
			
			
		</td>
	</tr>
	
		<tr>
		<td nowrap="true" valign="top" width="190px" class="ms-formlabel"><h3 class="ms-standardheader">
		<nobr>Status</nobr>
	</h3></td>
		<td valign="top" class="ms-formbody">
		<!-- FieldName="Status"
			 FieldInternalName="Status"
			 FieldType="SPFieldChoice"
		  -->
			<span dir="none"><select name="ctl00$m$g_7e20110a_595a_4c83_ad05_2423c63ac4d6$ctl00$ctl05$ctl12$ctl00$ctl00$ctl04$ctl00$DropDownChoice" id="ctl00_m_g_7e20110a_595a_4c83_ad05_2423c63ac4d6_ctl00_ctl05_ctl12_ctl00_ctl00_ctl04_ctl00_DropDownChoice" title="Status" class="ms-RadioText">
					<option selected="selected" value=""></option>
					<option value="Complete">Complete</option>
					<option value="In Progress">In Progress</option>
					<option value="Not Started">Not Started</option>
 
				</select><br/></span>
			
			
		</td>
	</tr>
	
		<tr>
		<td nowrap="true" valign="top" width="190px" class="ms-formlabel"><h3 class="ms-standardheader">
		<nobr>Completion Date</nobr>
	</h3></td>
		<td valign="top" class="ms-formbody">
		<!-- FieldName="Completion Date"
			 FieldInternalName="Completion_x0020_Date"
			 FieldType="SPFieldDateTime"
		  -->
			<span dir="none">
		<script type="text/javascript">g_strDateTimeControlIDs["SPCompletion_x0020_Date"] = "ctl00_m_g_7e20110a_595a_4c83_ad05_2423c63ac4d6_ctl00_ctl05_ctl13_ctl00_ctl00_ctl04_ctl00_ctl00_DateTimeField_DateTimeFieldDate";</script>
				<table border="0" cellpadding="0" cellspacing="0"><tr>
				<td class="ms-dtinput" >
				<label for="ctl00_m_g_7e20110a_595a_4c83_ad05_2423c63ac4d6_ctl00_ctl05_ctl13_ctl00_ctl00_ctl04_ctl00_ctl00_DateTimeField_DateTimeFieldDate" style="display:none">Completion Date Date</label>
				<input name="ctl00$m$g_7e20110a_595a_4c83_ad05_2423c63ac4d6$ctl00$ctl05$ctl13$ctl00$ctl00$ctl04$ctl00$ctl00$DateTimeField$DateTimeFieldDate" type="text" maxlength="45" id="ctl00_m_g_7e20110a_595a_4c83_ad05_2423c63ac4d6_ctl00_ctl05_ctl13_ctl00_ctl00_ctl04_ctl00_ctl00_DateTimeField_DateTimeFieldDate" title="Completion Date" class="ms-input" AutoPostBack="0" /></td>
				<td class="ms-dtinput" >
				<a href="#" onclick='clickDatePicker("ctl00_m_g_7e20110a_595a_4c83_ad05_2423c63ac4d6_ctl00_ctl05_ctl13_ctl00_ctl00_ctl04_ctl00_ctl00_DateTimeField_DateTimeFieldDate", "\u002fCNportal\u002f_layouts\u002fiframe.aspx?&amp;cal=1&amp;lcid=1033&amp;langid=1033&amp;tz=-08:00:00.0002951&amp;ww=0111110&amp;fdow=0&amp;fwoy=0&amp;hj=0&amp;swn=False&amp;minjday=109207&amp;maxjday=2666269&amp;date=", "", event);return false;' ><img id="ctl00_m_g_7e20110a_595a_4c83_ad05_2423c63ac4d6_ctl00_ctl05_ctl13_ctl00_ctl00_ctl04_ctl00_ctl00_DateTimeField_DateTimeFieldDateDatePickerImage" src="/_layouts/images/calendar.gif" border="0" alt="Select a date from the calendar."></img></a></td>
				<td>
				<iframe id="ctl00_m_g_7e20110a_595a_4c83_ad05_2423c63ac4d6_ctl00_ctl05_ctl13_ctl00_ctl00_ctl04_ctl00_ctl00_DateTimeField_DateTimeFieldDateDatePickerFrame" src="/_layouts/images/blank.gif" frameborder="0" scrolling="no" style="DISPLAY:none;POSITION:absolute; width:200px; Z-INDEX:101;" title="Select a date from the calendar."></iframe></td>
				</tr></table>
				
	</span>
			Required if status is &quot;Complete&quot;
			
		</td>
	</tr>
	
		<tr>
		<td nowrap="true" valign="top" width="190px" class="ms-formlabel"><h3 class="ms-standardheader">
		<nobr>AOT Designator</nobr>
	</h3></td>
		<td valign="top" class="ms-formbody">
		<!-- FieldName="AOT Designator"
			 FieldInternalName="AOT_x0020_Designator"
			 FieldType="SPFieldChoice"
		  -->
			<span dir="none"><select name="ctl00$m$g_7e20110a_595a_4c83_ad05_2423c63ac4d6$ctl00$ctl05$ctl14$ctl00$ctl00$ctl04$ctl00$DropDownChoice" id="ctl00_m_g_7e20110a_595a_4c83_ad05_2423c63ac4d6_ctl00_ctl05_ctl14_ctl00_ctl00_ctl04_ctl00_DropDownChoice" title="AOT Designator" class="ms-RadioText">
					<option selected="selected" value=""></option>
					<option value="Yes">Yes</option>
					<option value="No">No</option>
 
				</select><br/></span>
			
			
		</td>
	</tr>
	
		<tr>
		<td nowrap="true" valign="top" width="190px" class="ms-formlabel"><h3 class="ms-standardheader">
		<nobr>Realm</nobr>
	</h3></td>
		<td valign="top" class="ms-formbody">
		<!-- FieldName="Realm"
			 FieldInternalName="Realm"
			 FieldType="SPFieldLookup"
		  -->
			<span dir="none"><select name="ctl00$m$g_7e20110a_595a_4c83_ad05_2423c63ac4d6$ctl00$ctl05$ctl15$ctl00$ctl00$ctl04$ctl00$Lookup" id="ctl00_m_g_7e20110a_595a_4c83_ad05_2423c63ac4d6_ctl00_ctl05_ctl15_ctl00_ctl00_ctl04_ctl00_Lookup" title="Realm">
					<option selected="selected" value="0">(None)</option>
					<option value="1">Acquisition</option>
					<option value="6">Critical Change</option>
					<option value="3">Oversight</option>
					<option value="2">Requirements</option>
					<option value="4">Technical Design/Demo</option>
					<option value="5">Test</option>
 
				</select><br/></span>
			Required if AOT Designator is &quot;Yes&quot;
			
		</td>
	</tr>
	
		<tr>
		<td nowrap="true" valign="top" width="190px" class="ms-formlabel"><h3 class="ms-standardheader">
		<nobr>TicklerListDesignator</nobr>
	</h3></td>
		<td valign="top" class="ms-formbody">
		<!-- FieldName="TicklerListDesignator"
			 FieldInternalName="TicklerListDesignator"
			 FieldType="SPFieldChoice"
		  -->
			<span dir="none"><select name="ctl00$m$g_7e20110a_595a_4c83_ad05_2423c63ac4d6$ctl00$ctl05$ctl16$ctl00$ctl00$ctl04$ctl00$DropDownChoice" id="ctl00_m_g_7e20110a_595a_4c83_ad05_2423c63ac4d6_ctl00_ctl05_ctl16_ctl00_ctl00_ctl04_ctl00_DropDownChoice" title="TicklerListDesignator" class="ms-RadioText">
					<option selected="selected" value=""></option>
					<option value="Yes">Yes</option>
					<option value="No">No</option>
 
				</select><br/></span>
			
			
		</td>
	</tr>
	
		<tr>
		<td nowrap="true" valign="top" width="190px" class="ms-formlabel"><h3 class="ms-standardheader">
		<nobr>Contract</nobr>
	</h3></td>
		<td valign="top" class="ms-formbody">
		<!-- FieldName="Contract"
			 FieldInternalName="Contract"
			 FieldType="SPFieldText"
		  -->
			<span dir="none">
		<input name="ctl00$m$g_7e20110a_595a_4c83_ad05_2423c63ac4d6$ctl00$ctl05$ctl17$ctl00$ctl00$ctl04$ctl00$ctl00$TextField" type="text" maxlength="255" id="ctl00_m_g_7e20110a_595a_4c83_ad05_2423c63ac4d6_ctl00_ctl05_ctl17_ctl00_ctl00_ctl04_ctl00_ctl00_TextField" title="Contract" class="ms-long ms-spellcheck-true" /><br />
	</span>
			Populated based on Performer selected
			
		</td>
	</tr>
	
		<tr>
		<td nowrap="true" valign="top" width="190px" class="ms-formlabel"><h3 class="ms-standardheader">
		<nobr>Planned</nobr>
	</h3></td>
		<td valign="top" class="ms-formbody">
		<!-- FieldName="Planned"
			 FieldInternalName="Planned"
			 FieldType="SPFieldText"
		  -->
			<span dir="none">
		<input name="ctl00$m$g_7e20110a_595a_4c83_ad05_2423c63ac4d6$ctl00$ctl05$ctl18$ctl00$ctl00$ctl04$ctl00$ctl00$TextField" type="text" maxlength="255" id="ctl00_m_g_7e20110a_595a_4c83_ad05_2423c63ac4d6_ctl00_ctl05_ctl18_ctl00_ctl00_ctl04_ctl00_ctl00_TextField" title="Planned" class="ms-long ms-spellcheck-true" /><br />
	</span>
			
			
		</td>
	</tr>
	
		<tr>
		<td nowrap="true" valign="top" width="190px" class="ms-formlabel"><h3 class="ms-standardheader">
		<nobr>Staff Months</nobr>
	</h3></td>
		<td valign="top" class="ms-formbody">
		<!-- FieldName="Staff Months"
			 FieldInternalName="Staff_x0020_Months"
			 FieldType="SPFieldText"
		  -->
			<span dir="none">
		<input name="ctl00$m$g_7e20110a_595a_4c83_ad05_2423c63ac4d6$ctl00$ctl05$ctl19$ctl00$ctl00$ctl04$ctl00$ctl00$TextField" type="text" maxlength="255" id="ctl00_m_g_7e20110a_595a_4c83_ad05_2423c63ac4d6_ctl00_ctl05_ctl19_ctl00_ctl00_ctl04_ctl00_ctl00_TextField" title="Staff Months" class="ms-long ms-spellcheck-true" /><br />
	</span>
			
			
		</td>
	</tr>
	
		<tr>
		<td nowrap="true" valign="top" width="190px" class="ms-formlabel"><h3 class="ms-standardheader">
		<nobr>PlannedFunding</nobr>
	</h3></td>
		<td valign="top" class="ms-formbody">
		<!-- FieldName="PlannedFunding"
			 FieldInternalName="PlannedFunding"
			 FieldType="SPFieldText"
		  -->
			<span dir="none">
		<input name="ctl00$m$g_7e20110a_595a_4c83_ad05_2423c63ac4d6$ctl00$ctl05$ctl20$ctl00$ctl00$ctl04$ctl00$ctl00$TextField" type="text" maxlength="255" id="ctl00_m_g_7e20110a_595a_4c83_ad05_2423c63ac4d6_ctl00_ctl05_ctl20_ctl00_ctl00_ctl04_ctl00_ctl00_TextField" title="PlannedFunding" class="ms-long ms-spellcheck-true" /><br />
	</span>
			
			
		</td>
	</tr>
	
		<tr>
		<td nowrap="true" valign="top" width="190px" class="ms-formlabel"><h3 class="ms-standardheader">
		<nobr>CNID</nobr>
	</h3></td>
		<td valign="top" class="ms-formbody">
		<!-- FieldName="CNID"
			 FieldInternalName="CNID"
			 FieldType="SPFieldNumber"
		  -->
			<span dir="none">
		<input name="ctl00$m$g_7e20110a_595a_4c83_ad05_2423c63ac4d6$ctl00$ctl05$ctl21$ctl00$ctl00$ctl04$ctl00$ctl00$TextField" type="text" id="ctl00_m_g_7e20110a_595a_4c83_ad05_2423c63ac4d6_ctl00_ctl05_ctl21_ctl00_ctl00_ctl04_ctl00_ctl00_TextField" title="CNID" class="ms-input" size="11" style="ime-mode:inactive;" /><br />
	</span>
			
			
		</td>
	</tr>
	
			
			
		<tr id="idAttachmentsRow">
		<td nowrap="true" valign="top" class="ms-formlabel" width="20%">
		<h3 class="ms-standardheader">
		
		<nobr>Attachments</nobr>
	
		</h3>
		</td>
		<td valign="top" class="ms-formbody" width="80%">
	        <span dir="none">
		<table border="0" cellpadding="0" cellspacing="0" id="idAttachmentsTable">
			
		</table>

Open in new window

0
 
Rainer JeschorCommented:
Hi,

thanks for the HTML markup.

Here is the code:
<script type="text/javascript" src="http://dev.dse.local/sites/ee/SiteAssets/jquery-1.8.2.min.js"></script>
<script type="text/javascript">
        _spBodyOnLoadFunctionNames.push("OnStatusFieldChange");

        function CheckCompletionDateRequired(SelectedOption) {
                if (SelectedOption == "Complete")
                { return true; } else { return false; }
        }
 
        function PreSaveAction() {
                var text = jQuery("select[title='Status']").val();
                if(CheckCompletionDateRequired(text))
                {
                        var textCompletionDate = jQuery("input[title='Completion Date']").val();
                        if(textCompletionDate.length <= 0)
                        {       
                               alert('Please enter the completion date.');
                                return false;
                        }
                        else { return true;}
                }
                else
                { return true;}
        }

        function OnStatusFieldChange() {
                jQuery("select[title='Status']").change(function()
                {
                        var text = jQuery("select[title='Status']").val();
                        if(CheckCompletionDateRequired(text))
                        {
                                var textCompletionDate = jQuery("input[title='Completion Date']").val();
                                if(textCompletionDate.length <= 0)
                                {       
                                       alert('Please enter the completion date.');
									   jQuery("input[value='Save']").attr('disabled', true);
                                }
                        }
                        else
                        {
                                jQuery("input[value='Save']").attr('disabled', false);
                        }
                });
                jQuery("input[title='Completion Date']").blur(function()
                {
                        var text = jQuery("input[title='Completion Date']").val();
                        if(text.length <= 0)
                        {
                                jQuery("input[value='Save']").attr('disabled', true);
                        }
                        else
                        {
                                jQuery("input[value='Save']").attr('disabled', false);
                        }
                }); 
        }; 
</script>       

Open in new window

0
 
IsaacSharePoint Client Side DeveloperAuthor Commented:
RainerJ,

Sorry for the long delay.

This is awesome!  It works!

What is the best way to learn jQuery?
What resources would you recommend for a beginner.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now