Quantcast
Channel: SharePoint 2010 - General Discussions and Questions forum
Viewing all articles
Browse latest Browse all 17574

redirect browser to a different page when i add new item to a list

$
0
0

I have found quite a few posts on this and below seems like it may be the easiest (i'm quite new to sharepoint)

http://kishansharepoint.blogspot.in/2012/05/custom-list-forms-and-redirecting-after.html

1. In Sharepoint Designer take your EditForm.aspx and copy it.
2. Rename it
3. Open this new form and click on the PlaceHolderMain (leave your ListFormWebPart on the page)
4. In the ListFormWebPart scroll down the properties in the xml which describes the webpart and change <isvisible>to false. For some reason the form will not work unless you leave the original on the page.
4. Click on Insert->Sharepoint Controls->Custom List Form5. Choose the appropriate List and select Edit Form
6. Sharepoint generates the form for you. </isvisible>

To customize the save button, find the following control on the page Sharepoint:SaveButton

1. Delete the SaveButton
2. Add

input type="button" value="Save" name="btnSave" onclick="javascript: {ddwrt:GenFireServerEvent('__commit;__redirect={}')}"

instead

3. This button allows the form to be saved and redirects to back to that page

I've seen this example posted a few time but to delete the SaveButton what code do I actually delete?  Please see my code below:

</td>
      <td width="99%" class="ms-toolbar" nowrap="nowrap"><IMG SRC="/_layouts/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>

Also, do I put my redirect page

input type="button" value="Save" name="btnSave" onclick="javascript: {ddwrt:GenFireServerEvent('__commit;__redirect={do I put url here?} ')}"

thanks in advance!


Viewing all articles
Browse latest Browse all 17574

Trending Articles