Create Button in display form

Hi,

Looking to add a button that will allow the user to click it and it will then bring the user to the new form page. I have tried the redirect function pasted into the 'click' function but when i click the button after publishing the form nothing happens.

Hello @David_Conroy,

Welcome to Plumsail Community!

You can use this code to redirect a user to the new form on button click:

var listId = fd.spFormCtx.ListAttributes.Id;

//replace "https://domain.sharepoint.com/sites/sitename/subsite" with path to your site
//PageType=8 means New Form, no itemId is required
window.location.href =
"https://domain.sharepoint.com/sites/sitename/subsite/_layouts/15/listform.aspx?PageType=8&ListId="
+ listId;

Hi @mnikitina

Thanks for that, its working perfectly now.

1 Like