Welcome, Guest
Username: Password: Remember me

TOPIC: How to hide previous answer from next select list answers

How to hide previous answer from next select list answers 2 years 10 months ago #62187

  • combo
  • combo's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 2
  • Karma: 0
Hello. I have 3 questions with same answers on select list.
My problem is i do not wish that it is possible to select all three questions with same answers. They all must be different (you cannot select answer "A" for second question, if you selected "A" already for first question etc).
Any help would be appreciated. It is not necessary to hide previously answered question, aim is that it is not possible to select same answers from select list.

Thank you.
The administrator has disabled public write access.

Re: How to hide previous answer from next select list answers 2 years 10 months ago #62190

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 5838
  • Thank you received: 714
  • Karma: 222
Hello,

You can use Question type : Ranking

It's the easyest way.

If you really want someting different : use some javascript to hide some option:
Workarounds: Manipulating a survey at runtime using Javascript
The administrator has disabled public write access.

Re: How to hide previous answer from next select list answers 2 years 10 months ago #62221

  • combo
  • combo's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 2
  • Karma: 0
Thank you
I found the code
var previousQuestionAnswer = "{INSERTANS:1000X1X1}";
var currentQuestionID = "#answer1000X1X1"
 
$(document).ready(function() {  		
	// See if the answer for the previous question matches an answer in the current question
	// (other than 'No Answer')
	// If so, disable it.
	if (previousQuestionAnswer!='No Answer') {
		$(currentQuestionID).children().each(function(index, Element)
		{ 
			if ($(this).attr('text') == previousQuestionAnswer)  
				{ $(this).attr('disabled', true);}
			}    
		);}
}); // End of JQuery ready function
 

I dont know anything about javascript, but do I need to rename those "{INSERTANS:1000X1X1}" and "#answer1000X1X1" to something else. I cant figure what should I type there instead of these. Lets say my answer code is "A1", but renaming these to "{INSERTANS:A1}" and "#answerA1" wont work.
Any help would be appreciated, thank you for finding some time for dumbuser lol.
Last Edit: 2 years 10 months ago by combo.
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.148 seconds
Donation Image