
    function myFunction() {
    var e = document.getElementById("company");
    var companys=e.options[e.selectedIndex].getAttribute('name');
    console.log(companys);
    var options = document.getElementById('location').options;
        var location = document.getElementById('location');

        for (let i = 0; i < options.length; i++) {
    $('#location option:eq(' + i + ')').show();
            $('#location option:eq(' + "" + ')').show();

    console.log(options[i].getAttribute('name'));//log the value
            $('#location option:eq(' + ""+ ')').prop('selected', true);

            if(options[i].getAttribute('name') == companys){
    console.log(options[i].getAttribute('name'));
    //document.querySelector('select[id="lotexpiry"]').getAttribute('value') = dins;
    $('#location option:eq(' + i + ')').prop('selected', true);


}else{
    console.log('here');
    document.getElementById("location").options[i];
    $('#location option:eq(' + i + ')').hide();

}

}
myfunctionone();
}




    function myfunctionone() {
        var e = document.getElementById("location");
        var locations=e.options[e.selectedIndex].getAttribute('value');
        console.log(locations);
        var options = document.getElementById('service').options;
        var service = document.getElementById('service');

        for (let i = 0; i < options.length; i++) {
            $('#service option:eq(' + i + ')').show();
            $('#service option:eq(' + "" + ')').show();

            console.log(options[i].getAttribute('name'));//log the value
            $('#service option:eq(' + ""+ ')').prop('selected', true);

            if(options[i].getAttribute('name') == locations){
                console.log(options[i].getAttribute('name'));
                //document.querySelector('select[id="lotexpiry"]').getAttribute('value') = dins;
                $('#service option:eq(' + i + ')').prop('selected', true);


            }else{
                console.log('here');
                document.getElementById("service").options[i];
                $('#service option:eq(' + i + ')').hide();

            }

        }

    }


function whensubmit(){
   var value=  document.getElementById("service").value;
    if(value == ""){
        alert('PLEASE SELECT A SERVICE!!!');
        event.preventDefault();
    }
}
