// SCRIPT FOR USER ACCEPT THE RULES
$(document).ready(function(){

$(".next").hide();
$(function(){
    $("#book_id").change(function(){            

    if($(this).val() != "0"){
       // logic goes here1
       $(".next").show();
       //
        
        // THIS PART GET SUBMISSION RULES FROM BOOK SELECTED AND SHOW IN A PARAGRAPH   
        var book_id = document.getElementById("book_id").value;
        var url = document.getElementById("get_book_url").value;

        $.ajax({
            type: "POST",
            url: url,
            data: {book_id: book_id},
            success: function (response) {
                document.getElementById('submission_rules').innerHTML = response;
            },
        });
        //
    
    }else{
        // no option is selected
        $(".next").hide();
     }
   });

   $(".next_step1").click(function(){
    $(".next").hide();
   })

   $(document).on('change','#step2_checkbox',function() {
    a = $("input[type='checkbox']").val();
    if(this.checked){
        $(".next").show();
    } else {
        $(".next").hide();
    }
    })
});

});