0

Using SharePoint 2013.

We would like to create a single "new user" request form and when they select which system they are needing access to, a form specific to that system will drop down. So if I select one system, a certain set of questions will appear but if I select a different system, a different set of questions will appear. There will be some questions that are the same no matter what like the person's name, user id, manager, etc.

It's important to note that we do not have info path and I'm fairly new to SP and the IT world, so slowly learning. :)

TIA!

0

If you added your questions as fields in your list so your solution should depend on showing and hide specific questions (fields) based on the selected value from "system" choice field.

In this case, You can use Jquery to a show and hide a field based on your selected value by doing the following:

  • Open your customized 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(){
 // first hide all questions 
 $('nobr:contains("Quest1")').closest('tr').hide();
 $('nobr:contains("Quest2")').closest('tr').hide(); 
//Show/hide columns based on Choice Field Selection
$("select[title='system']").change(function() {
if ($("select[title='syetem']").val() != "system1")
{
$('nobr:contains("Quest1")').closest('tr').hide();
}
else
{
$('nobr:contains("Quest2")').closest('tr').show();
}
});
});

</script>

Note: system is the choice field name and Quest1 the field that you need to show or Hide, so replace this with your fields name. Also, the above example show and hide a field based on the selected value , so if you have multiple conditions, you should use if-else-if based on the number of values of your choice field.

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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