To achieve that in SPO, follow the steps below:
Edit the NewForm.aspx and add the following script to NewForm.aspx:
<script src="https://code.jquery.com/jquery-1.10.2.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function () {
// for Save button
var button = $('input[name$="SaveItem"]');
button.removeAttr("onclick");
button.click(function() {
var listUrl = "https://<tenant>.sharepoint.com/sites/<site>/Lists/<list>";
var listName = "<list>";
var parameter = "itemStatus";
var value = "new";
var elementName = $(this).attr("name");
var aspForm = $("form[id=aspnetForm]");
var oldPostbackUrl = aspForm.get(0).action;
var currentSourceValue = GetUrlKeyValue("Source", true, oldPostbackUrl);
var newPostbackUrl = oldPostbackUrl.replace(currentSourceValue, listUrl+"/EditForm.aspx?"+parameter+"="+value);
if (!PreSaveItem()) return false;
WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(elementName, "", true, "", newPostbackUrl, false, true));
});
});
</script>
Edit the EditForm.aspx and add the following script to EditForm.aspx:
<script src="https://code.jquery.com/jquery-1.10.2.min.js" type="text/javascript"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery.SPServices/0.7.1a/jquery.SPServices-0.7.1a.min.js"></script>
<script type="text/javascript">
function GetParameterValues(param) {
var url = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
for (var i = 0; i < url.length; i++) {
var urlparam = url[i].split('=');
if (urlparam[0] == param) {
return urlparam[1];
}
}
}
$(document).ready(function () {
var listUrl = "https://<tenant>.sharepoint.com/sites/<site>/Lists/<list>";
var itemStatus = GetParameterValues("itemStatus");
// check id there are id parameter in the current path
var id = GetParameterValues("ID");
if(itemStatus !== null && id == null){
if(itemStatus == "new"){
//get the latest item
var itemId = $().SPServices.SPGetLastItemId({
listName: "<list>"
});
if(itemId !== null){
// reload the EditFrom.aspx
var newPath = listUrl+"/EditForm.aspx?ID=" + itemId;
window.location.href = newPath;
}
}
}
});
</script>
Note: Change "<>" strings to your site and list information.