The code is to be placed on the page you want to show in landscape mode. If the whole survey is to be force attempted in landscape mode, the code can be written in the global footer.
The alert message is to be put in the footer using javascript if the condition is true.