I want to add a custom webpart on a custom list form and remove the Save and Cancel buttons which are default. Is what i'm trying to do possible? If yes please tell me a good approach to do it?
Thanks.........
One way at least is to use this CSS:
.ms-formtoolbar {
display: none;
}
ListFormWebPart
(I'm guessing you might be using both 2013 and this Web Part)
no, this code hide all bottons...
this is what you need i think
<script type=”text/javascript”>
var x=document.getElementsByTagName(“input”);
for (var i=0;i<x.length;i++)
{
if (x.item(i).type==”button”&&x.item(i).value==”Save and Close”)
{x.item(i).style.display = “none”};
}
</script>
<div style="padding-left:5px">
</ContentTemplate>
in newform.aspx and editform.aspx
you can edit the page by appending "&toolpaneview=2" , this will open the page in edit mode. Now hide the default webpart and add your custom webpart.
Create New and Edit forms in SharePOint Designer and change the ms-toolbar to ms-hidden.
This works for all fields
<tr>
<td class="ms-hidden" nowrap="nowrap">
<table>
<tr>
<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="savebutton1"/>
</td>
<td class="ms-separator"> </td>
<td class="ms-toolbar" nowrap="nowrap" align="right">
<SharePoint:GoBackButton runat="server" ControlMode="Edit" id="gobackbutton1"/>
</td>
</tr>
</table>
</td>
</tr>