Dynamically hide SharePoint input fields on NewForm or EditForm
Suppose you have a NewForm in a SharePoint list that contains a checkbox and several other input fields.
Whenever the checkbox is checked, some fields should be hidden. When unchecked, they shall be visible.
Also, if you have a lot of fields and the form opens as a modal dialogue, this dialogue should automatically be resized.
Note: I provided that code sample with the file extension .js for formatting purposes only. Please save the code with the .txt file extension.