Posts

Showing posts with the label List Form

Set SharePoint List Form Web Part field values using JavaScript when Creating New Item

How to set values of form fields generated by the SharePoint List Form Web Part when adding a new item to the list using JavaScript. Using a custom metadata field in a SharePoint list to set categorisation & filter criteria that is later used by List and Data View Web Parts to arrange & filter content for specific audiences.  Depending on the audience that a user is in, I wish to set alternate default values for specific fields rendered by the List Form Web Part. In most cases, a custom multiple choice field in the list will be set to a value which corresponds to the current user’s audience, but will sometimes need to be manually adjusted.  To improve the experience for end users, the appropriate checkbox option from the multiple choice field that corresponds to the current user’s audience will be selected when the form loads, and the default value for the field un-checked if required. The custom field is used in multiple content types across the primary site col...