0

I want to, when and edited iten is saved, to redirect to another page... i'm using the above code to change de source of the page. This causes the page to reload. No problem there...

if(stringURL.indexOf("AllItems")>-1){
    stringURL = stringURL.replace(stringURL.substring(stringURL.indexOf("Source="),stringURL.length),"Source="+_spPageContextInfo.webAbsoluteUrl+"/example.aspx?Code1="+code1.text()+"&code2="+code2);
    location.href = stringURL;

The problem is, when I hit the "save" button, evething after the & character just desapears.... it gives me a ulr like this:

http://example/example/Lists/myList/aprovar.aspx?ID=76&Source=http://example/example/SitePages/myPage.aspx?code1=123&code2=321

If I just copy the url and paste, it works fine... but when I hit the save button, it sends me to

http://example/example/SitePages/myPage.aspx?code1=123

If I put an & before code1, it gets removed too.

I have nothing else handling the url after this. Don't know why this is happening

0

Changin the & on the url:

Source=http://example/example/SitePages/myPage.aspx?code1=123&code2=321

for %26

Source=http://example/example/SitePages/myPage.aspx?code1=123%26code2=321

just solved my problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.