SharePoint Blogs / SharePoint University
SharePoint Blogs and SharePoint University - all in one place!
Need SharePoint Training? Attend a SharePoint Bootcamp!

Please delete cookies related to sharepointblogs.com and sharepointu.com to resolve login issues!

Customising the list/library forms toolbar

Sometimes it would be nice if we could replace the blue bar in the edit/view list items form. You might want to change the return page, i.e. to use the edit form from a webpart page and return after save and close, or maybe you'd want to lose the 'go back to list link'

Here's a way to do it, without messing with the listform webpart itself....

Clear standard toolbar and setup custom styles:-

Add this style code to the header in the editform.aspx file
<style>
.ms-toolbar {display : none;}  (clears the toolbar)
.mytoolbar1 {background-color: #e6e6e6;}  (add your own style for the custom bar)
.mytoolbar2 {
    border: medium none;
    font-size: 8pt;
    color: #101D8F;
    cursor: hand;
    background-color: #e6e6e6;
    text-align: left;
    vertical-align: center;
    TEXT-DECORATION: none;
    }
</style>


Now add your replacement toolbar back in before ms-bodyareaframe table:-

This one only has a save and close:-

    <table cellpadding=3 cellspacing=0 width="98%">
    <tr valign=center class="mytoolbar1">
    <td width="9" class="mytoolbar2"><IMG SRC="
http://xxxxxxx/_layouts/images/saveitem.gif" BORDER=0 /></td>
    <td width="100"><A class="mytoolbar2" href="BLOCKED SCRIPTSubmitForm();">Save and Close</A></td>
    <td></td>
    </tr>
    </table>

Other functions are:-
BLOCKED SCRIPTClickOnce(); = New form (save and close on a New iItem form)
BLOCKED SCRIPTSubmitForm();= Save and Close Edit Form
BLOCKED SCRIPTDeleteItem();= Delete


Now reset the return URL to where you want (add after webpart zone declaration)

<INPUT type=hidden name="NextUsing" id="NextUsing" value="http://sourceURL">

You can, of course, also pass the return URL using the querystring (?Source=xxxxx)


Posted 05-26-2006 4:38 PM by Unclaimed Blog

Add a Comment

(required)  
(optional)
(required)  
Remember Me?
Need SharePoint Training? Attend a SharePoint Bootcamp!
Posts (c) their respective authors. Everything else (c) 2009 SharePoint Experts, Inc.