Forum Discussion

fuenteso's avatar
fuenteso
Leader
7 years ago

Triggering a survey when a user accepts a solution

Hi,   We're looking for a way to survey our customers once they accepted a solution on our community. The goal is to survey only the user that accepted the solution, right after clicking the button...
  • peterlu's avatar
    7 years ago

    fuenteso

     

    <div class="InfoMessage lia-panel-feedback-inline-safe">
    	<div class="lia-text">
    		<p ng-non-bindable="" tabindex="0" role="action-succeed">Success!  This post is now an accepted solution.</p>
    	</div>
    </div>

    After page refreshes, you will see this success message. Simply use Lithium.jQuery to find the $('.lia-panel-feedback-inline-safe [role="action-succeed"]')   and test if the text match "Success!  This post is now an accepted solution.". Do not hard code this text, but use ${text.format("xxx")?js_string}

    If it passes the test, then you can trigger the survey.

     

    If it helps, a kudo :)