How to redirect url from Widget after submit to Service Portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2024 06:57 AM
Hello
I need redirect solution after submit form and it will redirect to sp portal from widget.
Thank You!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2024 10:43 AM
Hi @Ajay Singh2 ,
you can use below code in your widget
// This is part of the Client Script of the widget
function submitForm() {
var form = $scope.data.form;
// Submit the form or perform necessary actions here
form.submit().then(function(response) {
// After successful form submission, redirect to the Service Portal page
var redirectUrl = '/sp?id=your_target_page'; // Replace with your desired SP page URL
window.location.href = redirectUrl; // This will redirect the user
}).catch(function(error) {
// Handle any errors if needed
console.error('Form submission failed:', error);
});
}
Accept and like the solution if it helped.