0

How can I add button to footer of EditForm next to Save and Cancel buttons?

I want my new button to Save Changes and then Redirect to NewForm. I haven't come across anything that useful, maybe someone who has done it, can help?

I'm meaning something like this:

enter image description here

2

Add the URL of the next (current) form as the &Source=[url] parameter

The Source parameter in the URL is where the browser is redirected to after a Form is saved. Default behaviour is to return to the AllItems View.

Open an EditForm and investigate the URL

(the same construct can be used on a NewForm)

The URL has to be URL encoded (and it needs to be within the SharePoint domain)

https://xxx.sharepoint.com/sites/iCSR/Lists/Tasks/NewForm.aspx
?Source=
 https%3A%2F%2Fxxx.sharepoint.com%2Fsites%2FiCSR%2FLists%2FTasks%2FAllItems%2Easpx
&RootFolder=

So if you replace that Source with URL of your NewForm

https%3A%2F%2Fxxx.sharepoint.com%2Fsites%2FiCSR%2FLists%2FTasks%2FNewForm.aspx

You can add an item and then be returned to a Blank NewForm

You might also be interested in:

Limit only one entry per day per user in sharepoint list

1

I did it quickly. Follow the links I posted and create a new EditForm.aspx.

The essential part ist this:

        <tr>
        <td class="ms-toolbar" nowrap="nowrap">
            <table>
                <tr>
                    <td class="ms-descriptiontext" nowrap="nowrap">
                        <SharePoint:CreatedModifiedInfo ControlMode="Edit" runat="server"/>
                    </td>                       
                    <td>
                    <input type="button" class="contact-button" value="Save + Redirect" name="btnSave" onclick="javascript: {ddwrt:GenFireServerEvent('__commit;__redirect={NewForm.aspx}')}" />
                    </td>
                    <td width="99%" class="ms-toolbar" nowrap="nowrap"><IMG SRC="/_layouts/15/images/blank.gif" width="1" height="18"/></td>
                    <td class="ms-toolbar" nowrap="nowrap">
                        <SharePoint:SaveButton runat="server"  ControlMode="Edit" id="savebutton2"/>
                    </td>
                    <td class="ms-separator"> </td>
                    <td class="ms-toolbar" nowrap="nowrap" align="right">
                        <SharePoint:GoBackButton runat="server" ControlMode="Edit" id="gobackbutton2"/>
                    </td>
                </tr>
            </table>
        </td>
    </tr>

Here the CustomEditForm.aspx

enter image description here

You can also place the button in between the columns. Just take the three lines:

<td>
  <input type="button" class="contact-button" value="Save + Redirect" name="btnSave" onclick="javascript: {ddwrt:GenFireServerEvent('__commit;__redirect={CustomNewForm.aspx}')}" />
</td>

and place it somewhere in between. e.G. I placed it between the lines 125-129.

enter image description here

After that the CustomEditForm looks like that:

enter image description here

  • Nice, going to test it out, hopefully it works! :) – Taurib Feb 26 '16 at 14:46
  • Any news here? Did it help? – Patrick Feb 29 '16 at 9:19
  • Yes, this method does indeed work, there are just other problems, since I need to custom layout and custom amount of fields. For that there is a script, that hides all fields and displays, what are needed. Currently with that it doesn't seem to have good easy integration. If ContentLink tells you anything. – Taurib Mar 1 '16 at 13:41
  • But is there a way, that I could just add this button to random place in content and it would do the same job? Currently, when I add this input directly to content, it doesn't do anything – Taurib Mar 2 '16 at 10:08
  • updated the answer. Hope this helps – Patrick Mar 2 '16 at 15:16

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.