Default "Close" button returns to the "Allitems.aspx" page of the perticular list. If you want to navigate to the different page,then you have to add the following javascript which is used to hide the default button also add the custom button to navigate to the back page.
Step 1: Hide the default Close button
for( var j=0 ; j<2 ;j++) //Since we are having two buttons on the form.
{
var btnClose = GetElementByType("input", "button")
//var btnClose = newitm.parentNode.parentNode.outerHTML;
if(btnClose != null)
{
btnClose.outerHTML = ""; //Hide the parent tag of the button i.e. outerHtml.
}
}
function GetElementByType(tagName, type)
{
var a = document.getElementsByTagName(tagName);
for (var i=0; i < a.length; i++)
{
if (a[i].type)
{
if (a[i].type== type)
{
return a[i];
}
}
}
return null;
}
Step 2: Add custom button and navigate it to the back page.
Add the following values in to div inside ContentPlaceHolder tag .
where,
INPUT TYPE="button"
VALUE="Go Back"
onClick="history.back()"
No comments:
Post a Comment