Difference between revisions of "Close to URL"
(→Example) |
|||
(2 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
− | == | + | <translate> |
− | + | == Close URL == | |
− | == | ||
− | |||
− | == Code == | + | In order to show a specific site when he clicks on the Close button |
− | <source lang="javascript | + | |
+ | As a questionnaire creator | ||
+ | |||
+ | I want the respondent to be automatically redirected to a URL when he clicks on the Close button | ||
+ | |||
+ | '''Example''' | ||
+ | |||
+ | When user finished the questionnaire , you want them to redirect to Catglobe homepage | ||
+ | |||
+ | === Solution === | ||
+ | |||
+ | *Add a Page question to Questionnaire editor like below | ||
+ | *Go to menu Properties -> Question properties -> Common tab -> Check End | ||
+ | |||
+ | [[Image:CloseURL Properties.png]] | ||
+ | |||
+ | *Go to menu Properties -> Question scripts -> Java script tab -> Input below script | ||
+ | |||
+ | [[Image:CloseURL Code.png]] | ||
+ | |||
+ | === Code === | ||
+ | |||
+ | <source lang="javascript"> | ||
function closeToURL() | function closeToURL() | ||
{ | { | ||
Line 11: | Line 31: | ||
} | } | ||
quest.close = closeToURL; | quest.close = closeToURL; | ||
− | </source> | + | </source> |
+ | |||
+ | === Source === | ||
+ | |||
+ | Questionnaire Resource Id on cg site: 159730 | ||
+ | </translate> |
Latest revision as of 09:19, 3 August 2017
Contents
Close URL
In order to show a specific site when he clicks on the Close button
As a questionnaire creator
I want the respondent to be automatically redirected to a URL when he clicks on the Close button
Example
When user finished the questionnaire , you want them to redirect to Catglobe homepage
Solution
- Add a Page question to Questionnaire editor like below
- Go to menu Properties -> Question properties -> Common tab -> Check End
- Go to menu Properties -> Question scripts -> Java script tab -> Input below script
Code
function closeToURL()
{
document.location = "http://www.catglobe.com";
}
quest.close = closeToURL;
Source
Questionnaire Resource Id on cg site: 159730