I have a long survey preamble. Respondents have to scroll to the very bottom to click "Next" to start the survey. Is there code that I can use to insert a button within the first "Text/Graphic" question type near the top of the page (right below the survey title/not in the Header) to start the survey? I'd also like to be able to customize the wording on the button. Thanks in advance!
Hi researcher1
you can do this by:
- go to the html editor for the question text
- add a button on the top
- you might want to add two tags
- one for the button
- one for the text below
- this two divs you can use to position the button and and the text by css
- style the button to your liking in the css part of the style
- add the below java script
Qualtrics.SurveyEngine.addOnReady(function()
{
// start survey by clicking on a button
this.questionclick = function(event,element)
{
console.log(event, element);
if (element.id == 'surveyStartButton') // insert the id of your survey start button
{
alert('You clicked the start button'); // for testing only remove before going live
this.clickNextButton() // clicks on the next button and thus starts the survey
}
}
});
Best regards
Rudi
Hi Rudi, Thank you so much for your step-by-step instructions and sharing your code. I had some difficulties but a kind colleague at work who is more familiar with HTML and JavaScript helped me out. It works perfectly now!
Hi Rudi
I created the button in HTML except I am not sure where I should put the javascript you have attached in your message. should i add it in the “java section” in Qualtrics or this should be just within the HTML provision in the question section?
Lastly, for the id for the start button do I use the button id used in HTML in which case it would be “myFunction31()” according to the HTML code for creating button below...
<br><br>
<button onclick="myFunction31()">Start Survey</button>
<script> function myFunction31()
</script>
Leave a Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.