Hi!
I have a side by side question that has 2 columns:
* The first with Radio buttons where responders have to say if they have a characteristic (rows) - YES or NO
* The second is a free text field where they need to indicate a number.
In the case where the responder says no, I want to automatically populate the correspondent free text field with "0". This value should also be visible if the respondent submits the answer and then decides to return.
Is it possible to do? I'm really not comfortable with JS, especially regarding the manipulation of SbS questions.
Thanks!
Ana
Page 1 / 1
Use the below code in the JS onReady of SBS question
jQuery("#"+this.questionId+" input[type='radio']").on('click',function(){
if(jQuery(this).val()==1){
jQuery(this).closest(".Choice ").find(".InputText").val('');
}else{
jQuery(this).closest(".Choice ").find(".InputText").val('0');
}
});
jQuery("#"+this.questionId+" input[type='radio']").on('click',function(){
if(jQuery(this).val()==1){
jQuery(this).closest(".Choice ").find(".InputText").val('');
}else{
jQuery(this).closest(".Choice ").find(".InputText").val('0');
}
});
It works!!! Thanks!! 😀
Leave a Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.