Skip to content
Loading
  
  •                                                                                                            class="col-md-8">  
  •                                                                                                                "text" name="[email protected]" class="checkboctext" placeholder="Other Field" id="@i.Id">  
  •                                                                                                              
  •                                                                                                        }  
  •                                                                                                        else  
  •                                                                                                        {  
  •                                                                                                            "checkbox" name="chkbox" @*class="checktextclass"*@ id="@i.Id" value="@i.Id" />@i.AnswerOption  
  •                                                                                                        }  
  •                                                                                                    }  
  •                                                                                                         
  •                                                                                                        }  
  •  
     I have Used below code for Radio button in same functionality
    1. $('.answerDropdown option:selected').each(function (i) {  
    2. var isotherField: $(this).closest('.txtdrop').next().next('.col-md-4').find('input[type=text]').val(),  
    3. });  
    this code is work properly.
    but in Checkbox I below code I try
    1. $.each($("input[name=chkbox]:checked"), function () {  
    2.                 
    3.                    isotherField:$(this).closest('.checkother').next().next('.col-md-8').find('input[type=text]').val(),  
    4.                                    })  
    5.            });  
     please Help me.
    +1
  • +1
    var txtvalue = $(this).closest("input[type=text]").val();
     
    this code is not working...
    undefine message in alert 
    +1
  • +1
    i don't understand ur code please explain more step by step if u possible??.
     
    for (var q = 1; q <= 15; m++) {
    if ($('#chkQuestionNo_' + q).is(":checked")) {
    //Write your if part
    }else{
    //Write your else part
    }
    }
    +1
  • +1
    @suraj sir
     
    Question is dynamically added. so there is no limit for any Question.
    i cant use Textbox to textbox15 this method is not possible. 
    +1