I'm trying to hide field C when field A equals B on the NewForm page. I used the JSLink attribute to add my scripts to the NewForm page.
<Form Type="NewForm" Url="NewForm.aspx" SetupPath="pages\form.aspx" WebPartZoneID="Main" JSLink="../Scripts/HideEndDateDuration.js|../Scripts/jquery-1.9.1.js"/>
I get a warning that the JSLink attribute is not declared.
I ignore that and try to test if it works. Here is my jquery to hide the field :
$(document).ready(function(){
//Show/hide columns based on Drop Down Selection
$("select[title='StartDate']").change(function() {
if ($("select[title='StartDate']").val() == $("select[title='EndDate']").val())
{
$('nobr:contains("EndDateDuration")').closest('tr').hide();
}
else
{
$('nobr:contains("EndDateDuration")').closest('tr').show();
}
});
});
However nothing happens. When debugging in developer tools , the script is not even loaded when the form loads.
Any ideas of what i'm doing wrong?
Thanks a lot!
~sitecollection/..../furtherURL/.... E.g.~sitecollection/siteassets/--/--/HideEndDateDuration.js– Rohit Waghela Oct 09 '17 at 10:09