简体   繁体   English

按钮单击事件后停留在同一页面上

[英]Stay on same page after button click event

We use a survey link for feedback A suffix is use after the URL to make sure all SP components are not seen. 我们使用调查链接获取反馈。在URL后使用后缀以确保未看到所有SP组件。 When suffix is used there is a cancel button at the bottom which needs to be hidden or removed. 使用后缀时,在底部有一个取消按钮,该按钮需要隐藏或删除。 And also when user clicks on finish button it navigates to a blank page, is it possible to give an alert like "Thanks for your feedback" and stay on the same page after button click event. 而且,当用户单击“完成”按钮时,它会导航到空白页面,是否可以发出“谢谢您的反馈”之类的警报,并在按钮单击事件发生后停留在同一页面上。

I am using this piece of code and this doesn't help. 我正在使用这段代码,这没有帮助。

<input type="button" Text="Finish" value="Form Action" name="btnFormAction0" onclick="javascript:     {ddwrt:GenFireServerEvent ('__commit)')};alert('Your survey has been submitted  Successfully');window.parent.location='https://team.SharePoint.com/teams/Prod/Lists/Comm_Mgmt/newform.aspx?IsDlg=1'" />

My suggestion is that, your finish button redirect user to a new page, then on the new page, you create a on document ready call, over there you can trigger an alter function. 我的建议是,您的完成按钮会将用户重定向到新页面,然后在新页面上创建一个文档准备就绪的调用,在那可以触发alter函数。 please me know if you need more details about this. 请让我知道您是否需要更多详细信息。

cheers 干杯

The Javascript code inside of the onclick attribute has errors. onclick属性内的Javascript代码包含错误。

GenFireServerEvent ('__commit)'

Should be 应该

GenFireServerEvent('__commit')

If the page is still redirected, then I believe it may be due to some code in the GenFireServerEvent function or an HTTP 300 Redirection Response from your backend. 如果页面仍被重定向,那么我认为这可能是由于GenFireServerEvent函数中的某些代码或后端的HTTP 300重定向响应GenFireServerEvent

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM