SharePoint – Forms, Create Save & Continue buttons

Sometimes you want to make life a bit easier, for the end user.

When entering data in a list saving the result and next :

Continue Editing using the edit form or jump the Display Form immediately showing the result.

Solution :

1. Create 2 extra button the NewForm.aspx

<td class="ms-toolbar" nowrap="nowrap"><input type="button" value="Save and Continue Editing" style="font-size:8" name="btnSave" onclick="javascript: {ddwrt:GenFireServerEvent(concat('__commit;__redirect={',$RedirectEdit,'}'))}" /></td>
<td class="ms-separator"> </td>
<td class="ms-toolbar" nowrap="nowrap"><input type="button" value="Save then Display"  name="btnSave2" onclick="javascript: {ddwrt:GenFireServerEvent(concat('__commit;__redirect={',$RedirectDisp,'}'))}" /></td>


2. Next create 2 XSL variables

Here is the variables definition. These will hold the redirect URL information.

<xsl:variable name="RedirectEdit">EditForm.aspx?ID=<xsl:value-of select="$ListItemId"/></xsl:variable>
<xsl:variable name="RedirectDisp">DisplayForm.aspx?ID=<xsl:value-of select="$ListItemId"/></xsl:variable>

Which get’s fired when pressing the button (see code button) :



3. Next you need to create 1 Parameter variable.

This parameters will hold the List Item ID, which we will grab from the URL Query String. And feed to the variables.

In the SP Designer go to the Parameters button in the Ribbon.



Now you are done !

This will save him / her a few clicks, everybody happy. Smile


2 Responses to SharePoint – Forms, Create Save & Continue buttons

  1. says:

    in which file do you add the xsl variables?

  2. Everything in SharePoint is done using SharePoint Designer;…

    Each list or libr. contains 3 forms (New.aspx,Display.aspx and Edit.aspx)

    That is where all the code has to go…

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: