$(".datepicker").datepicker({
	format: "mm/dd/yyyy",
	clearBtn: !0,
	multidate: !0,
	multidateSeparator: ",",
	autoclose: !0,
	todayHighlight: !0
});
$(".input-daterange-datepicker").daterangepicker({
	buttonClasses: ["btn", "btn-sm"],
	applyClass: "btn-secondary",
	cancelClass: "btn-primary",
	showDropdowns:true,
	
});
$(".select2").select2();
    $(".select2-limiting").select2({
        maximumSelectionLength: 6
    })
    
    $(document).ready(function() {
        var radio_selected = $('input[name="aadhar"]:checked').val()
        if(radio_selected == 1){
            $('#adhar-input').show();
            $('#national-id').hide();
            
        }else{
            $('#adhar-input').hide();
            $('#national-id').show();
        }
    })
    $("input[name='aadhar']").click(function(){
        var radioValue = $("input[name='aadhar']:checked").val();
        if(radioValue == 1){
            $('#adhar-input').show();
            $('#national-id').hide();
            $('#national-id-num').hide();
        }else{
            $('#adhar-input').hide();
            $('#national-id').show();
        }
    });
    
    $('#national-id-num').hide();
    $('#id-card').on('change', function() {
      var data = $("#id-card option:selected").text();		  
      if(data == "Select Id Card"){
        $('#national-id-num').hide();
      }else{
          $('#national-id-num').show();
      }
    })

    
    
    $('.aadhar-no').mask('0000-0000-0000');
    $('.mobile-no').mask('0000000000');

    
    
$(document).ready(function() {
	var max_fields = 15; //maximum input boxes allowed
	var wrapper = $(".input_fields_wrap"); //Fields wrapper
	var add_button = $(".add-delete-btn"); //Add button ID
	var x = 1; //initlal text box count
	$(add_button).click(function(e){ //on add input button click
		e.preventDefault();
		if(x < max_fields){ //max input box allowed
		x++; //text box increment
		$(wrapper).append('<fieldset><legend>Family Member '+ x +'</legend><a class="btn btn-danger add-delete-btn2" href="javascript:void(0);"><i class="fa fa-minus"></i></a><div class="row"><div class="col-md-4"><div class="form-group"><label class="col-form-label">Name</label><div class="input-group"><input type="text" class="form-control" placeholder="" name="m-name[]"><div class="input-group-append"><select class="form-control" name="relation[]"><option value="">Relation</option><option value="Father">Father</option><option value="Mother">Mother</option><option value="Uncle">Uncle</option><option value="Uncle">Aunty</option><option value="Wife">Wife</option><option value="Husband">Husband</option><option value="Brother">Brother</option><option value="Sister">Sister</option></select></div></div></div></div><div class="col-md-4"><div class="form-group"><label class="col-form-label">Age:</label><input type="number" class="form-control" name="mage[]"> </div></div><div class="col-md-4"><div class="form-group"><label class="col-form-label">Education:</label><select class="form-control" name="meducation[]"><option value="">Education</option><option value="Post Graduate">Post Graduate</option><option value="Graduate">Graduate</option><option value="12th">12th</option><option value="10th">10th</option><option value="8th">8th</option><option value="5th">5th</option></select></div></div><div class="col-md-4"><div class="form-group"><label class="col-form-label">Occupation:</label><input type="text" class="form-control" name="moccupation[]"></div></div><div class="col-md-4"><div class="form-group"><label class="col-form-label">Monthly Income:</label><div class="input-group"><div class="input-group-prepend"><div class="input-group-text"><i class="fa fa-rupee-sign"></i></div></div><input type="text" class="form-control" name="mmincome[]"></div></div></div></div></fieldset>'); //add input box
		}
	});
	$(wrapper).on("click",".add-delete-btn2", function(e){ //user click on remove text
	e.preventDefault(); $(this).parent('fieldset').remove(); x--;
	})
});

$(".dropify").dropify({
		messages:{
			default:"Drag and drop a file here or click",
			replace:"Drag and drop or click to replace",
			remove:"Remove",
			error:"Ooops, something wrong appended."
		},
		error:{
			fileSize:"The file size is too big (1M max)."
		}
		
});
$(".btn-fixed-circle").hover(
  function () {
	$(this).closest('.add-button-bg').addClass("active");
  },
  function () {
	$(this).closest('.add-button-bg').removeClass("active");
  }
);    