Question

I am trying to figure out how to redirect from DispForm to EditForm. I want to be able to click on a task and enter directly in Edit Mode.

I have this snippet and it should work but it doesn't:

<script type="text/javascript">

var ActualURL = window.location.href;
var SecondURL = ActualURL.replace(“DispForm.aspx”, “EditForm.aspx”);
window.location.replace(SecondURL);

</script>

What am I doing wrong?

Was it helpful?

Solution

It's work fine just replace “ & ” with " and It's work fine. Please make sure you put this code on display form.

<script type="text/javascript">
var ActualURL = window.location.href;
var SecondURL = ActualURL.replace("DispForm.aspx", "EditForm.aspx");
window.location.replace(SecondURL);
</script>
Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top