Have an idea?

Visit Sawtooth Software Feedback to share your ideas on how we can improve our products.

onEnter and onExit logics

I would like to display an alert message say for example "Hi! Welcome! " when I enter into Q1 and another alter message "Thank you!" would have to be displayed when I leave from Q1. is it possible to write onEnter & onExit logics?
asked Jun 20 by raaamuz (290 points)

1 Answer

+1 vote
An alert upon loading up a question can be put in the question's question texts, HTML head, etc.:

<script>
alert('Hi');
</script>


If you want to trigger an alert when the page submits, one possibility would be adding custom JavaScript verification to the question set to run after system verification.  The verification could be as simple as "alert('Bye');", but it will need more code if you have normal custom verification as well.

Note that if a website shows too many alerts, many modern browsers will prompt the user whether or not they want future alerts hidden.
answered Jun 20 by Zachary Platinum Sawtooth Software, Inc. (116,925 points)
Thanks, please confirm whether can I use the same way to write any logic?
Say for example,  If I want to add the the response of Q1 & Q2 and display this in Q3, can I write logic in question text area of Q3?
Give it a shot and tell me if you have any problems.
...