Quantcast
Viewing all articles
Browse latest Browse all 6517

Commented Issue: Problems with RedirectWithId function in sharepoint 2013 [10214]

Hi!
I has problem when using RedirectWithId function in my NewForm.aspx.
My code in NewForm.aspx:
```
<asp:Content ContentPlaceHolderId="PlaceHolderMain" runat="server">

<script type="text/javascript" src="/sites/sitename/SiteAssets/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="/sites/sitename/SiteAssets/jquery.SPServices-2013.02a.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$().SPServices.SPRedirectWithID({
redirectUrl: "EditForm.aspx",
qsParamName: "ID"
});
});
</script>
...
```
First of all, why do we use form[name='aspnetForm'] selector in this function? Main form has id equals to "aspnetForm", but not the name. On the line 3911 we use "#aspnetForm" as selector.
Ok, I've changed it myself, all code goes correctly step by step in debugger, set action to new url in code. But I don't see new action attached to form in debugger and after post from data it redirects me to AllItems.aspx list view (original source url).
I reproduced this code and behavior on the simplest list with only one Title field

Help me please, what I'm doing wrong?
Comments: After some investigation I've found that document.ready doesn't work for this functionality, because sharepoinr override action attribute after RedirectWithID completes. I tried manually set action to correct url, but sharepoint just ignore it and redirect to AllItems page. I'm not sure that this is SPServices issue now... But do you know how get the same functionality in sharepoint 2013? This will be very helpful for me. Thanks anyway for your attention

Viewing all articles
Browse latest Browse all 6517

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>