Solved
A code for a pop-over or pop-up window to prompt participants to check their answers
Hi, I am trying to do a pop-up or pop-over in one question to prompt participants to check their answers before moving on. This window or intercept should come up when they press next for to move onto the next question. Appreciate it if I can be directed to a question or discussion thread related to this or any help with codes are greatly appreciated! Thanks!
Best answer by Anonymous
Hello @Xxtan ;
For this, we need a fake next button to make popover.
Step 1: Paste the following code in the look and feel -> advanced -> add custom css
#CustomButton{
border: none;
color: #fff;
font-size: 16px;
padding: 8px 20px;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
-ms-border-radius: 4px;
-o-border-radius: 4px;
border-radius: 4px;
cursor: pointer;
margin: 0;
text-align: center;
text-decoration: none;
-webkit-appearance: none;
transition: background .3s;
background-color: #c32432;
}
Step 2: Paste the following code in the js(onready) of the question for which you want the popover:
const that=this;
this.hideNextButton();
var btn = jQuery('<div id="Buttons"><input id="CustomButton" class="NextButton Button" title=" Next " type="button" name="NextButton" value=" Next " aria-label="Next"></div>')
jQuery('#Buttons').append(btn);
jQuery('#CustomButton').on('click', function(){
var txt;
var e= jQuery("[id='QR~QID1']").val()
var r = confirm("Please check your email address "+e); //design your question here
if (r == true) {
that.clickNextButton();
} else {
}
});
Now in the above code, we are confirming the email address of the user through open text, fetching of response for the question will differ with question type.
Output:
!
View original
Leave a Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.