Is it possible to create a expand/collapse like kind of UI form for the SPLIST's newform.aspx ?
Am having the similar requirement, customer wants to create a UI newform.aspx with divided into multiple sections
with expand/collapse options.
am having admin section as well with access to only a set of users(added inside a sp group).
here is the link, i have gone through , i have created this
https://sharepoint.stackexchange.com/questions/232008/how-to-create-sections-in-list-form-sharepoint2013/232053
but, with the requirement now, am not able to convert this into a expand/collapse sections.
<script src="//code.jquery.com/jquery-3.2.1.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(function () {
//set section text and field name
AddSectionBeforeField("Informatat baze","Last Name");
AddSectionBeforeField("Employment Data","Company");
});
function AddSectionBeforeField(sectionText,fieldName){
var $fieldTR=$(".ms-standardheader nobr:contains('"+fieldName+"')").closest("tr");
$fieldTR.before("<tr style='background-color:gainsboro'><td colspan='2' class='ms-formbody' style='padding:0'><div style='font-size:16px;font-weight:bold;'>"+sectionText+"</div></td></tr>");
}
</script>
![]()
how to make the above as Expand/collapse ( maye b with a +sign or - sign or any other icon)
any help is appreciated!