如果if语句"return true",页面重定向在"PreSavAaction"中功能 [英] page redirect when if statement "return true" in "PreSavAaction" function
问题描述
"PreSaveAction";如果语句返回true,则需要重定向页面.
"PreSaveAction" if statement return true, i need to redirect the page.
我的newfrom.aspx URL看起来像这样(https://test/lists/listname/newforrm.aspx?ID = 22)
My newfrom.aspx URL looks like this ( https://test/lists/listname/newforrm.aspx?ID=22 )
点击保存"按钮后,我需要重定向以上链接
Upon clicking save button i need the above link to be redirected
我可以在如果不是"的情况下重定向语句使用window.location.href
i'm able to redirect when "if else" statement return false using window.location.href
但是当语句返回true时它无法重定向
but it couldn't redirect when statement return true
我什至尝试了这篇文章中的方法
i even tried the method from this post
https://social.technet.microsoft.com/Forums/sharepoint/zh-CN/f0ee4e38-26d0-40fb-8800-97d31ce1c8bf/presaveaction-redirect-url-if-validation-success-or-return-true ?forum = sharepointdevelopment,(不为我工作)
https://social.technet.microsoft.com/Forums/sharepoint/en-US/f0ee4e38-26d0-40fb-8800-97d31ce1c8bf/presaveaction-redirect-url-if-validation-success-or-return-true?forum=sharepointdevelopment, (not working for me)
任何 帮助
推荐答案
senyjab,
Hi senyjab,
尝试使用以下格式设置newform.aspx URL.
Try to set your newform.aspx URL with below format.
https://test/lists/listname/newforrm.aspx?Source =<< Redirect URL>""
https://test/lists/listname/newforrm.aspx?Source="<Redirect URL>"
示例:
https://test/lists/listname/newforrm.aspx?Source = https://test/
https://test/lists/listname/newforrm.aspx?Source=https://test/
这会将用户导航到相应的重定向URL,并将数据成功提交到SP列表.
This will navigate user to respective redirection URL along with Successful data submission to SP List.
谢谢
Dillibabu
Dillibabu
这篇关于如果if语句"return true",页面重定向在"PreSavAaction"中功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!