1

Hi firstly I am new on SharePoint and this platform and very eager to learn

Is it possible to make a form that tailors the information entered based on the choices made within the form?

I have a choice column, 100%, and 80% if 100% is selected then the form remains the same but if 80% is selected two more column should appear.

Thank you in advance.

1

You can use a Jquery in your Edit Form Page of your document library to show and hide fields based on the choice field selection as the following:

  • Navigate to your document library page.
  • In the URL address only replace AllItems.aspx with EditForm.aspxto be like this http://SiteURL/<Library Name>/Forms/EditForm.aspx
  • From Right Setting Gear > Click on Edit Page.

enter image description here

  • Add web Part > Add Script Editor.

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='Field1']").change(function() {
if ($("select[title='Field1']").val() != "Yes")
{
$('nobr:contains("Field2")').closest('tr').hide();
}
else
{
$('nobr:contains("Field2")').closest('tr').show();
}
});
});

</script>

Where Field1 is the Choice Field Title and Field2 is the Field Title that you need to Show / Hide.

For Example: the Choice field title in your for is called Percent so replace Field1 in the above code to Percent

For more details

1

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.