Lets say we need to add a new Save to the Add or Edit page that saves the record and redirects the user back to the List page.
1. Add a new button to the Add or Edit page via Insert button function in Page Designer.
2. Add the following code to the ClientBefore event of the button:
pageObj.on('beforeSave', function(formObj, fieldControlsArr, pageObj){
formObj.baseParams['golist'] = "1";
});
$("#saveButton1").click();
return false;
3. Add the following code to the AfterAdd event of the Add page or AfterEdit event of the Edit page:
if($_REQUEST["golist"])
{
header("Location: ..._list.php");
exit();
}
See also:
•Insert Standard button. Add page
•Insert Standard button. Edit page
•Troubleshooting custom buttons
•How to enable/disable a button