take-survey Widget Submit Button
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-24-2024 06:53 AM
#want to customize take survey widget submit button #n portal#
#I am using the Clone version of 1)surveys and Assessmet widget id=take_assessment
which ultimately call "take-survey" widget i am using the cloned version of it also for my customization
in my case i want to change the features of the submit button
on clicking of the submit button user should get a alert
and after submit it should redirect to a particular link ...I tried to identify the on click function for the submit button in the client script but it is not working....
maybe this is the function for the submit function
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-24-2024 07:02 AM
I would like to know the solution to this as well.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-24-2024 08:50 AM
Hello @abhi56
In surveys and Assessment widget in the html and client script check this:
This is responsible for the submit button functionality.
Hope this helps!
"If you found my answer helpful, please like and mark it as an "accepted solution". It helps others find the solution more easily and supports the community!"
Thank You
Juhi Poddar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-24-2024 08:59 AM
Hi @Juhi Poddar
I tried to add an alert msg on click of submit it is not working,
am I doing anything wrong?
Thank you
Abhinandan Nayak
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-24-2024 09:18 AM
Hi @abhi56
You can create a new function showAlert() and call it on click of Submit button. The closeSurvey Function will be called once user confirms.
Updated script in HTML:
<button class="btn btn-default" ng-click="c.showAlert()">{{data.assessment.parameterizedMsgsMap.close_btn_msg}}</button>
Updated script in client script:
c.showAlert = function() {
if (confirm("Your message here") == true) {
c.closeSurvey();
}
};
c.closeSurvey = function() {
iframePayload.action = 'close';
$window.postMessage(iframePayload, window.location.origin);
};
Hope this helps!
"If you found my answer helpful, please like and mark it as an "accepted solution". It helps others find the solution more easily and supports the community!"
Thank You
Juhi Poddar