var selectedRecode;
this.questionclick = function(event, element) {
if(element.type == "radio")
{ selectedRecode = this.getChoiceRecodeValue(this.getSelectedChoices());
alert(selectedRecode);}}
It works fine now, however I'd like to place this code to another question on the same page while the code will be still related to the original question. Therefore I want to put the question object into a variable and replace `this` in code by this variable. Unfortunately I haven't found out how to get the question object. I could probably send my recorde to embedded data each time, but I think there must be some way how to get the object of the previous question...
I've tried following modification of my original code. There was no error, but nothing happened when I clicked on a choice.
var Q = jQuery( "#QID460" );
var selectedRecode;
Q.questionclick = function(event, element) {
if(element.type == "radio")
{ selectedRecode = Q.getChoiceRecodeValue(Q.getSelectedChoices());
alert(selectedRecode);}}
Thanks for any ideas!
Best answer by fleb
View original