0

Within my SharePoint 2013 form I have a field labeled "Type of Outage" which has different six different choices. Further down the form I have fields labeled "day of the week" and "week #". These two fields are used in order for me to sort within views the way I need to. I don't want users to be confused and think information needs to be placed here.

I would like to disable "day of the week" field at all times unless "type of outage" is equal to "telework". I would like to do the same with "week #" if "type of outage" is equal to "AWS".

I did see this question asked recently but I feel like I am needing something a little different:

Question

Thanks for the assistance.

  • 1
    The question you're linking to, and its duplicate, both have correct answers to what you're trying to do. Pick one, try it, and if you get stuck then ask us for help. – Erin L Nov 9 '16 at 20:17
0

To avoid users confusion , I suggest instead of disabling / enable you can show and hide theses fields on demand based on your choice field selected value via Jquery by doing the following :

  • Open your new form via the browser.
  • Edit Page .

enter image description here

  • Add web Part > Add Script Editor .

enter image description here

Add the following code.

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script>

$(document).ready(function(){
//Show/hide columns based on Choice Field Selection
$("select[title='Type of Outage']").change(function() {
if ($("select[title='Type of Outage']").val() != "telework")
{
$('nobr:contains("day of the week")').closest('tr').hide();
}
else
{
$('nobr:contains("day of the week")').closest('tr').show();
}
});
});

</script>

For step by step guide with images check Show / Hide fields based on choice field selection using JQuery in SharePoint

  • Thanks for the assistance but this is not working for me. The field stays no matter the choice. – Flat Banana Nov 9 '16 at 21:04
  • Dear @FlatBanana first make sure that you provide the correct field name , the second Are you tried to change the value in the choice field after you add this code ? third are you need to hide it once the form opened ? the last thing is it the default SharePoint form. I am pretty sure the above code is working where I wrote the attached article and I mentioned all details with screenshot , so please try to make sure you do the mentioned instructions , also don't hesitate to tell me if you need more clarification – Mohamed El-Qassas MVP Nov 9 '16 at 22:57

Not the answer you're looking for? Browse other questions tagged or ask your own question.