Answered
Need to validate True or False dropdown box
Hi there! I have some True or False questions added to my PDF using the field Dropdown1 (Dropdown2, etc.). I need a way to validate if their answer is correct. How can I accomplish this?
Hi there! I have some True or False questions added to my PDF using the field Dropdown1 (Dropdown2, etc.). I need a way to validate if their answer is correct. How can I accomplish this?
Try something like this in a button as 'Mouse UP' action (Run a JavaScript):
var correct = 0;
for( var i=1; i<=5; i++){
var drop = this.getField("Dropdown"+i).valueAsString;
if(i==1 || i==3 || i==5){
if(drop === "True")
correct++;}
else if(i==2 || i==4){
if(drop === "False")
correct++;}}
app.alert("User have "+correct+"/5 answers correct.",3 );Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.