And here is the JS code that’s invoked when an option is selected (from http://secure.surveymonkey.com/js/RankingQuestion.js?rv=201303191245):
RankingQuestion.RankChange = function(e) { if (e == null) var e = window.event; var target = e.target ? e.target : e.srcElement;
if (target.selectedIndex == 0 || SM_APP.DOM.hasClass(target.options[target.selectedIndex], 'disabledOption')) { target.selectedIndex = parseInt(target.getAttribute('oldIdx')); } else if (target.options[target.selectedIndex].getAttribute("isNa") == 'true') { setTimeout(function() { target.parentNode.childNodes[1].checked = true; RankingQuestion.ToggleNA(target.parentNode, true); RankingQuestion.FadeIn(target.parentNode); }, 100); } else { var opt = target.parentNode; var container = opt.parentNode; var pos = target.selectedIndex - 1; RankingQuestion.MovePlaceHolder(pos, opt);
setTimeout(function() { container.insertBefore(opt, RankingQuestion.PlaceHolder); container.removeChild(RankingQuestion.PlaceHolder); RankingQuestion.FadeIn(opt); RankingQuestion.CalculateRanks(container); }, 100); } };
And here is the JS code that’s invoked when an option is selected (from http:// secure. surveymonkey. com/js/ RankingQuestion .js?rv= 201303191245):
RankingQues tion.RankChange = function(e) {
if (e == null)
var e = window.event;
var target = e.target ? e.target : e.srcElement;
if (target. selectedIndex == 0 || SM_APP. DOM.hasClass( target. options[ target. selectedIndex] , 'disabledOption')) {
target. selectedIndex = parseInt( target. getAttribute( 'oldIdx' )); options[ target. selectedIndex] .getAttribute( "isNa") == 'true') {
setTimeout (function( ) {
target. parentNode. childNodes[ 1].checked = true;
RankingQuesti on.ToggleNA( target. parentNode, true);
RankingQuesti on.FadeIn( target. parentNode) ; selectedIndex - 1;
RankingQue stion.MovePlace Holder( pos, opt);
} else if (target.
}, 100);
} else {
var opt = target.parentNode;
var container = opt.parentNode;
var pos = target.
}, 100);
}
};